Commit aead8c5f authored by Vasil Velichkov's avatar Vasil Velichkov Committed by Lev Walkin

Fix a memory leak in SEQUENCE_free

Fixes check-src/check-135.-gen-OER.c and check-src/check64-136.-gen-OER.c
parent 84dd0fef
...@@ -994,6 +994,9 @@ void ...@@ -994,6 +994,9 @@ void
SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr, SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr,
enum asn_struct_free_method method) { enum asn_struct_free_method method) {
size_t edx; 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) if(!td || !sptr)
return; return;
...@@ -1013,6 +1016,10 @@ SEQUENCE_free(const asn_TYPE_descriptor_t *td, void *sptr, ...@@ -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) { switch(method) {
case ASFM_FREE_EVERYTHING: case ASFM_FREE_EVERYTHING:
FREEMEM(sptr); FREEMEM(sptr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment