From: banjiuqingshan <63209634+banjiuqingshan@users.noreply.github.com> Date: Sat, 18 Jun 2022 17:43:51 +0000 (+0800) Subject: Fix memory leak when using testsolv to execute cases X-Git-Tag: 0.7.23~59^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a361f5248557e032f15890aac54c0db53c52098;p=thirdparty%2Flibsolv.git Fix memory leak when using testsolv to execute cases *resultp will only keep the pointer of the last cycle, which will lead to memory leakage. This solves the first memory leak problem in issue #496 "==255147==error..." --- diff --git a/ext/testcase.c b/ext/testcase.c index 035cfdbd..c529057a 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -2448,7 +2448,10 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res } } if (resultp) + { + solv_free(*resultp); *resultp = result; + } else solv_free(result); if (resultflagsp)