From: Rich Salz Date: Fri, 9 Sep 2016 14:52:59 +0000 (-0400) Subject: GH1555: Don't bump size on realloc failure X-Git-Tag: OpenSSL_1_1_0a~21 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=bf0404fe4afe9ed1e09e11b2b8f82b9ec127de91 GH1555: Don't bump size on realloc failure Reviewed-by: Richard Levitte (cherry picked from commit 6fcace45bda108ad4d3f95261494dd479720d92c) --- 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; }