Skip to content

Commit

Permalink
Fix resource leak in opj_j2k_create_cstr_index
Browse files Browse the repository at this point in the history
Fixes #599
  • Loading branch information
mayeut committed Sep 17, 2015
1 parent c16c917 commit 55dbf8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 55dbf8a

Please sign in to comment.