Fix resource leak in opj_j2k_create_cstr_index

Fixes #599
This commit is contained in:
mayeut 2015-09-17 12:46:42 +02:00
parent c16c91797f
commit 55dbf8acff
1 changed files with 3 additions and 1 deletions

View 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;