Mercurial > hg > freeDiameter
diff 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 |
line wrap: on
line diff
--- a/libfdproto/messages.c Thu Feb 24 17:19:14 2011 +0900 +++ b/libfdproto/messages.c Thu Feb 24 17:19:42 2011 +0900 @@ -1217,12 +1217,11 @@ /* Now we have to set the value */ memcpy(&avp->avp_storage, value, sizeof(union avp_value)); - /* Copy an octetstring if needed. */ + /* Duplicate an octetstring if needed. */ if (type == AVP_TYPE_OCTETSTRING) { if (value->os.len) { - CHECK_MALLOC( avp->avp_storage.os.data = malloc(value->os.len) ); + CHECK_MALLOC( avp->avp_storage.os.data = os0dup(value->os.data, value->os.len) ); avp->avp_mustfreeos = 1; - memcpy(avp->avp_storage.os.data, value->os.data, value->os.len); } else { avp->avp_storage.os.data = NULL; }