From: Olivier Matz Date: Thu, 21 Jun 2018 17:10:38 +0000 (+0200) Subject: fix invalid free X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4f770798433567dc0e179c75888b591255842220;p=protos%2Flibecoli.git fix invalid free --- diff --git a/lib/ecoli_strvec.c b/lib/ecoli_strvec.c index d8f4a86..ff75f1e 100644 --- a/lib/ecoli_strvec.c +++ b/lib/ecoli_strvec.c @@ -373,6 +373,7 @@ static int ec_strvec_testcase(void) testres |= EC_TEST_CHECK(ec_strvec_cmp(strvec, strvec2) == 0, "strvec and strvec2 should be equal\n"); ec_strvec_free(strvec2); + strvec2 = NULL; f = open_memstream(&buf, &buflen); if (f == NULL) @@ -401,7 +402,9 @@ static int ec_strvec_testcase(void) testres |= EC_TEST_CHECK(ec_strvec_cmp(strvec, strvec2) == 0, "strvec and strvec2 should be equal\n"); ec_strvec_free(strvec2); + strvec = NULL; ec_strvec_free(strvec); + strvec2 = NULL; return testres;