Mercurial > hg > freeDiameter
comparison libfdproto/messages.c @ 730:e21d79595045
minor improvements
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Thu, 24 Feb 2011 17:19:42 +0900 |
parents | 2c7c423eaba9 |
children | 4a9f08d6b6ba |
comparison
equal
deleted
inserted
replaced
729:5d8ac5da7092 | 730:e21d79595045 |
---|---|
1215 } | 1215 } |
1216 | 1216 |
1217 /* Now we have to set the value */ | 1217 /* Now we have to set the value */ |
1218 memcpy(&avp->avp_storage, value, sizeof(union avp_value)); | 1218 memcpy(&avp->avp_storage, value, sizeof(union avp_value)); |
1219 | 1219 |
1220 /* Copy an octetstring if needed. */ | 1220 /* Duplicate an octetstring if needed. */ |
1221 if (type == AVP_TYPE_OCTETSTRING) { | 1221 if (type == AVP_TYPE_OCTETSTRING) { |
1222 if (value->os.len) { | 1222 if (value->os.len) { |
1223 CHECK_MALLOC( avp->avp_storage.os.data = malloc(value->os.len) ); | 1223 CHECK_MALLOC( avp->avp_storage.os.data = os0dup(value->os.data, value->os.len) ); |
1224 avp->avp_mustfreeos = 1; | 1224 avp->avp_mustfreeos = 1; |
1225 memcpy(avp->avp_storage.os.data, value->os.data, value->os.len); | |
1226 } else { | 1225 } else { |
1227 avp->avp_storage.os.data = NULL; | 1226 avp->avp_storage.os.data = NULL; |
1228 } | 1227 } |
1229 } | 1228 } |
1230 | 1229 |