From 7009f604163c937553e3194e85f43c0b79881ab3 Mon Sep 17 00:00:00 2001 From: Pavol Sloboda Date: Fri, 11 Apr 2025 13:15:09 +0200 Subject: [PATCH] fix: added the closing of the file descriptor if the check_mysql_rc macro will return FAIL to avoid memory leaks --- unittest/libmariadb/misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unittest/libmariadb/misc.c b/unittest/libmariadb/misc.c index 983dc071..b24969bb 100644 --- a/unittest/libmariadb/misc.c +++ b/unittest/libmariadb/misc.c @@ -287,6 +287,8 @@ static int test_frm_bug(MYSQL *mysql) } rc= mysql_query(mysql, "SHOW TABLE STATUS like 'test_frm_bug'"); + if (rc) + fclose(test_file); check_mysql_rc(rc, mysql); result= mysql_store_result(mysql);