summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2016-09-09 10:52:59 -0400
committerRich Salz <rsalz@openssl.org>2016-09-21 10:41:13 -0400
commitbf0404fe4afe9ed1e09e11b2b8f82b9ec127de91 (patch)
tree0d832ed14055d0c5b10bcaa532990fd031bafff7 /crypto
parent64d1cc09f912fdc92b12588cc9ad189978051a3e (diff)
GH1555: Don't bump size on realloc failure
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 6fcace45bda108ad4d3f95261494dd479720d92c)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/lhash/lhash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c
index 19c6d2c31d..adde832cc4 100644
--- a/crypto/lhash/lhash.c
+++ b/crypto/lhash/lhash.c
@@ -213,8 +213,8 @@ static int expand(OPENSSL_LHASH *lh)
j = (int)lh->num_alloc_nodes * 2;
n = OPENSSL_realloc(lh->b, (int)(sizeof(OPENSSL_LH_NODE *) * j));
if (n == NULL) {
- /* fputs("realloc error in lhash",stderr); */
lh->error++;
+ lh->num_nodes--;
lh->p = 0;
return 0;
}