From 38ceb848f5c06778d3bfc7de4f8588b78649c06a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 25 Aug 2019 11:47:49 +0200 Subject: [PATCH] Fix memory leak --- src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c | 4 +++- src/core/libs/supl/asn-supl/constr_SEQUENCE.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c index e6d435617..dbf96b18c 100644 --- a/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c +++ b/src/core/libs/supl/asn-rrlp/constr_SEQUENCE.c @@ -1151,8 +1151,10 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(!epres) _ASN_DECODE_STARVED; /* Get the extensions map */ - if(per_get_many_bits(pd, epres, 0, bmlength)) + if(per_get_many_bits(pd, epres, 0, bmlength)) { + FREEMEM(epres); _ASN_DECODE_STARVED; + } memset(&epmd, 0, sizeof(epmd)); epmd.buffer = epres; diff --git a/src/core/libs/supl/asn-supl/constr_SEQUENCE.c b/src/core/libs/supl/asn-supl/constr_SEQUENCE.c index e6d435617..a20057539 100644 --- a/src/core/libs/supl/asn-supl/constr_SEQUENCE.c +++ b/src/core/libs/supl/asn-supl/constr_SEQUENCE.c @@ -1151,9 +1151,10 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, if(!epres) _ASN_DECODE_STARVED; /* Get the extensions map */ - if(per_get_many_bits(pd, epres, 0, bmlength)) + if(per_get_many_bits(pd, epres, 0, bmlength)) { + FREEMEM(epres); _ASN_DECODE_STARVED; - + } memset(&epmd, 0, sizeof(epmd)); epmd.buffer = epres; epmd.nbits = bmlength;