From be65f8ae06b6e481f7d4b3a896624bc9d37498bc Mon Sep 17 00:00:00 2001 From: vit9696 Date: Tue, 26 Mar 2019 14:59:13 +0300 Subject: [PATCH] Fix one more resource leak --- common/bstrlib/bstrlib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/bstrlib/bstrlib.c b/common/bstrlib/bstrlib.c index e44e76d..0c051f6 100644 --- a/common/bstrlib/bstrlib.c +++ b/common/bstrlib/bstrlib.c @@ -2398,7 +2398,10 @@ int i, c, v; } else { v = (bl->qty - 1) * len; if ((bl->qty > 512 || len > 127) && - v / len != bl->qty - 1) return NULL; /* Overflow */ + v / len != bl->qty - 1) { + bstr__free (b); + return NULL; /* Overflow */ + } if (v > INT_MAX - c) { bstr__free (b); return NULL; /* Overflow */