From: Peter Johnson Date: Sun, 5 Mar 2006 22:40:44 +0000 (-0000) Subject: * hamt.c (HAMT_delete_trie): Close memory leak (max'ing of size would make X-Git-Tag: v0.5.0rc2~5^2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=990eded860f9618007f9bfc4c960a6dd24cb4cb1;p=yasm * hamt.c (HAMT_delete_trie): Close memory leak (max'ing of size would make size=0 instead of 32 when the actual size was 32). svn path=/trunk/yasm/; revision=1407 --- diff --git a/libyasm/hamt.c b/libyasm/hamt.c index f93c51b0..aef6b522 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -114,7 +114,8 @@ HAMT_delete_trie(HAMTNode *node) /* Count total number of bits in bitmap to determine size */ BitCount(Size, node->BitMapKey); - Size &= 0x1F; /* Clamp to <32 */ + if (Size > 32) + Size = 32; for (i=0; iBitMapKey); - Size &= 0x1F; /* Clamp to <=32 */ - if (Size == 0) + if (Size > 32) Size = 32; newnodes = yasm_xmalloc(Size*sizeof(HAMTNode));