1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

fix: added the closing of the test_file before various fail statements

to avoid memory leaks
This commit is contained in:
Pavol Sloboda
2025-04-11 12:10:26 +02:00
committed by Georg Richter
parent 056f09bb06
commit c10a3479fb

View File

@@ -292,18 +292,26 @@ static int test_frm_bug(MYSQL *mysql)
check_mysql_rc(rc, mysql);
result= mysql_store_result(mysql);
if(!result)
fclose(test_file);
FAIL_IF(!result, "Invalid result set");/* It can't be NULL */
rc= 0;
while (mysql_fetch_row(result))
rc++;
if(rc != 1)
fclose(test_file);
FAIL_UNLESS(rc == 1, "rowcount != 1");
mysql_data_seek(result, 0);
row= mysql_fetch_row(result);
if(!row)
fclose(test_file);
FAIL_IF(!row, "couldn't fetch row");
if(row[17] != 0)
fclose(test_file);
FAIL_UNLESS(row[17] != 0, "row[17] != 0");
mysql_free_result(result);