mirror of https://gerrit.osmocom.org/asn1c
freeing properly
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1277 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
parent
206313dde8
commit
a325c8b17d
|
@ -808,16 +808,16 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
|
||||||
|
|
||||||
asn_set_empty(list); /* Remove (list->array) */
|
asn_set_empty(list); /* Remove (list->array) */
|
||||||
|
|
||||||
if(!contents_only) {
|
|
||||||
FREEMEM(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
specs = (asn_SET_OF_specifics_t *)td->specifics;
|
specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||||
ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
|
ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
|
||||||
if(ctx->ptr) {
|
if(ctx->ptr) {
|
||||||
ASN_STRUCT_FREE(*elm->type, ctx->ptr);
|
ASN_STRUCT_FREE(*elm->type, ctx->ptr);
|
||||||
ctx->ptr = 0;
|
ctx->ptr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!contents_only) {
|
||||||
|
FREEMEM(ptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue