Mercurial > hg > freeDiameter
comparison libfdproto/messages.c @ 753:71833fa5e35f
allow applications to create empty AVP also
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Sat, 24 Sep 2011 13:00:30 +0200 |
parents | 9e9840ccf059 |
children | edbdb35a603f |
comparison
equal
deleted
inserted
replaced
752:9e9840ccf059 | 753:71833fa5e35f |
---|---|
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 /* Duplicate 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 CHECK_MALLOC( avp->avp_storage.os.data = os0dup(value->os.data, value->os.len) ); |
1223 CHECK_MALLOC( avp->avp_storage.os.data = os0dup(value->os.data, value->os.len) ); | 1223 avp->avp_mustfreeos = 1; |
1224 avp->avp_mustfreeos = 1; | |
1225 } else { | |
1226 avp->avp_storage.os.data = NULL; | |
1227 } | |
1228 } | 1224 } |
1229 | 1225 |
1230 /* Set the data pointer of the public part */ | 1226 /* Set the data pointer of the public part */ |
1231 avp->avp_public.avp_value = &avp->avp_storage; | 1227 avp->avp_public.avp_value = &avp->avp_storage; |
1232 | 1228 |