You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
fix: added the necessary frees for the bind var before any of the
check_stmt_rc() and check_mysql_rc() macros potentialy return from the fuction
This commit is contained in:
committed by
Georg Richter
parent
92a8b3b529
commit
9fb319a7e7
@@ -5167,9 +5167,13 @@ static int test_maxparam(MYSQL *mysql)
|
|||||||
FAIL_UNLESS(bind, "Not enough memory");
|
FAIL_UNLESS(bind, "Not enough memory");
|
||||||
|
|
||||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
|
||||||
|
if (rc)
|
||||||
|
free(bind);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
rc= mysql_query(mysql, "CREATE TABLE t1 (a int)");
|
rc= mysql_query(mysql, "CREATE TABLE t1 (a int)");
|
||||||
|
if (rc)
|
||||||
|
free(bind);
|
||||||
check_mysql_rc(rc, mysql);
|
check_mysql_rc(rc, mysql);
|
||||||
|
|
||||||
buffer= calloc(1, mem);
|
buffer= calloc(1, mem);
|
||||||
@@ -5180,6 +5184,8 @@ static int test_maxparam(MYSQL *mysql)
|
|||||||
for (i=0; i < 65534.; i++)
|
for (i=0; i < 65534.; i++)
|
||||||
strcat(buffer, ",(?)");
|
strcat(buffer, ",(?)");
|
||||||
rc= mysql_stmt_prepare(stmt, SL(buffer));
|
rc= mysql_stmt_prepare(stmt, SL(buffer));
|
||||||
|
if (rc)
|
||||||
|
free(bind);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
for (i=0; i < 65534; i++)
|
for (i=0; i < 65534; i++)
|
||||||
@@ -5189,9 +5195,13 @@ static int test_maxparam(MYSQL *mysql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc= mysql_stmt_bind_param(stmt, bind);
|
rc= mysql_stmt_bind_param(stmt, bind);
|
||||||
|
if (rc)
|
||||||
|
free(bind);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
|
if (rc)
|
||||||
|
free(bind);
|
||||||
check_stmt_rc(rc, stmt);
|
check_stmt_rc(rc, stmt);
|
||||||
|
|
||||||
FAIL_IF(mysql_stmt_affected_rows(stmt) != 65535, "Expected affected_rows=65535");
|
FAIL_IF(mysql_stmt_affected_rows(stmt) != 65535, "Expected affected_rows=65535");
|
||||||
|
Reference in New Issue
Block a user