From: mayeut Date: Thu, 17 Sep 2015 10:46:42 +0000 (+0200) Subject: Fix resource leak in opj_j2k_create_cstr_index X-Git-Tag: v2.1.1~22^2~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55dbf8acff9afab1591b6a094b744d8426a32dd4;p=openjpeg Fix resource leak in opj_j2k_create_cstr_index Fixes #599 --- diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index ec3635b6..f7a1d764 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -8603,8 +8603,10 @@ static opj_codestream_index_t* opj_j2k_create_cstr_index(void) cstr_index->marknum = 0; cstr_index->marker = (opj_marker_info_t*) opj_calloc(cstr_index->maxmarknum, sizeof(opj_marker_info_t)); - if (!cstr_index-> marker) + if (!cstr_index-> marker) { + opj_free(cstr_index); return NULL; + } cstr_index->tile_index = NULL;