diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-07-20 00:03:44 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-07-20 00:03:44 +0200 |
commit | ec0e217b0647eb798576a7d3366b39c159c00624 (patch) | |
tree | 88404309798e2fac2844b4e76224b6ad1d7c5375 /src/constr_SET_OF.c | |
parent | b1e3ee75318536dac0a91817c5e4d35d61893ba6 (diff) |
Update to asn1c official repository svn trunk r1409
Diffstat (limited to 'src/constr_SET_OF.c')
-rw-r--r-- | src/constr_SET_OF.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/constr_SET_OF.c b/src/constr_SET_OF.c index 09f27db..11eac57 100644 --- a/src/constr_SET_OF.c +++ b/src/constr_SET_OF.c @@ -227,6 +227,8 @@ SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, } /* Fall through */ case RC_FAIL: /* Fatal error */ + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; RETURN(RC_FAIL); } /* switch(rval) */ @@ -787,8 +789,10 @@ SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, void SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { if(td && ptr) { + asn_SET_OF_specifics_t *specs; asn_TYPE_member_t *elm = td->elements; asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr); + asn_struct_ctx_t *ctx; /* Decoder context */ int i; /* @@ -804,6 +808,13 @@ SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) { asn_set_empty(list); /* Remove (list->array) */ + specs = (asn_SET_OF_specifics_t *)td->specifics; + ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset); + if(ctx->ptr) { + ASN_STRUCT_FREE(*elm->type, ctx->ptr); + ctx->ptr = 0; + } + if(!contents_only) { FREEMEM(ptr); } @@ -819,7 +830,7 @@ SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr, int i; if(!sptr) { - _ASN_CTFAIL(app_key, td, + _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; @@ -921,7 +932,7 @@ SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ASN_DEBUG("Failed to add element into %s", td->name); /* Fall through */ - rv.code == RC_FAIL; + rv.code = RC_FAIL; } else { ASN_DEBUG("Failed decoding %s of %s (SET OF)", elm->type->name, td->name); |