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

Added the call to FAIL_UNLESS to handle the possibility of the

allocation of buffer failing to ensure we don't work with NULL further
in the test, also added a free to bind in this case to avoid a memory
leak
This commit is contained in:
Pavol Sloboda
2025-05-26 12:27:39 +02:00
committed by Georg Richter
parent ba0da1df94
commit 0fc940259a

View File

@@ -5172,6 +5172,9 @@ static int test_maxparam(MYSQL *mysql)
check_mysql_rc(rc, mysql);
buffer= calloc(1, mem);
if(!buffer)
free(bind);
FAIL_UNLESS(bind, "Not enough memory");
strcpy(buffer, query);
for (i=0; i < 65534.; i++)
strcat(buffer, ",(?)");