]> granicus.if.org Git - openjpeg/commitdiff
Fix resource leak in opj_j2k_create_cstr_index
authormayeut <mayeut@users.noreply.github.com>
Thu, 17 Sep 2015 10:46:42 +0000 (12:46 +0200)
committermayeut <mayeut@users.noreply.github.com>
Thu, 17 Sep 2015 10:46:42 +0000 (12:46 +0200)
Fixes #599

src/lib/openjp2/j2k.c

index ec3635b6e8cb550a4b3019f999fff79923a4362a..f7a1d764e3babd4e9da8312d7b968bedf44093a1 100644 (file)
@@ -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;