mirror of https://gerrit.osmocom.org/asn1c
Fix a memory leak in SEQUENCE_free
Fixes check-src/check-135.-gen-OER.c and check-src/check64-136.-gen-OER.c
This commit is contained in:
parent
84dd0fef6f
commit
aead8c5f68
|
@ -994,6 +994,9 @@ void
|
|||
SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
|
||||
enum asn_struct_free_method method) {
|
||||
size_t edx;
|
||||
const asn_SEQUENCE_specifics_t *specs =
|
||||
(const asn_SEQUENCE_specifics_t *)td->specifics;
|
||||
asn_struct_ctx_t *ctx; /* Decoder context */
|
||||
|
||||
if(!td || !sptr)
|
||||
return;
|
||||
|
@ -1013,6 +1016,10 @@ SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
|
|||
}
|
||||
}
|
||||
|
||||
/* Clean parsing context */
|
||||
ctx = (asn_struct_ctx_t *)((char *)sptr + specs->ctx_offset);
|
||||
FREEMEM(ctx->ptr);
|
||||
|
||||
switch(method) {
|
||||
case ASFM_FREE_EVERYTHING:
|
||||
FREEMEM(sptr);
|
||||
|
|
Loading…
Reference in New Issue