From: Mickael Savinaud Date: Thu, 15 Nov 2012 16:37:57 +0000 (+0000) Subject: [trunk] solve a potential bug when we test the realloc X-Git-Tag: version.2.0~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3c59b010bf1350da595025c0a214756992e6c24;p=openjpeg [trunk] solve a potential bug when we test the realloc --- diff --git a/src/lib/openjp2/tgt.c b/src/lib/openjp2/tgt.c index c82b06ed..06930d49 100644 --- a/src/lib/openjp2/tgt.c +++ b/src/lib/openjp2/tgt.c @@ -170,7 +170,7 @@ opj_tgt_tree_t *opj_tgt_init(opj_tgt_tree_t * p_tree,OPJ_UINT32 p_num_leafs_h, O if (l_node_size > p_tree->nodes_size) { opj_tgt_node_t* new_nodes = (opj_tgt_node_t*) opj_realloc(p_tree->nodes, l_node_size); - if (! p_tree->nodes) { + if (! new_nodes) { fprintf(stderr, "ERROR Not enough memory to reinitialize the tag tree\n"); opj_tgt_destroy(p_tree); return 00;