summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authormayeut <mayeut@users.noreply.github.com>2015-09-17 12:46:42 +0200
committermayeut <mayeut@users.noreply.github.com>2015-09-17 12:46:42 +0200
commit55dbf8acff9afab1591b6a094b744d8426a32dd4 (patch)
tree956bb42227cb76665a909a41e4248d06f90a02be /src/lib
parentc16c91797f4b15eb55d56f85fd497d588331e71f (diff)
Fix resource leak in opj_j2k_create_cstr_index
Fixes #599
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/j2k.c4
1 files changed, 3 insertions, 1 deletions
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;