File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1337,12 +1337,16 @@ parseQuery(Command *cmd, const char *raw_sql)
1337
1337
if (cmd -> argc >= MAX_ARGS )
1338
1338
{
1339
1339
fprintf (stderr , "statement has too many arguments (maximum is %d): %s\n" , MAX_ARGS - 1 , raw_sql );
1340
+ free (name );
1340
1341
return false;
1341
1342
}
1342
1343
1343
1344
sprintf (var , "$%d" , cmd -> argc );
1344
1345
if ((p = replaceVariable (& sql , p , eaten , var )) == NULL )
1346
+ {
1347
+ free (name );
1345
1348
return false;
1349
+ }
1346
1350
1347
1351
cmd -> argv [cmd -> argc ] = name ;
1348
1352
cmd -> argc ++ ;
@@ -1504,7 +1508,10 @@ process_commands(char *buf)
1504
1508
case QUERY_EXTENDED :
1505
1509
case QUERY_PREPARED :
1506
1510
if (!parseQuery (my_commands , p ))
1511
+ {
1512
+ free (my_commands );
1507
1513
return NULL ;
1514
+ }
1508
1515
break ;
1509
1516
default :
1510
1517
return NULL ;
@@ -1560,6 +1567,7 @@ process_file(char *filename)
1560
1567
commands = process_commands (& buf [i ]);
1561
1568
if (commands == NULL )
1562
1569
{
1570
+ free (my_commands );
1563
1571
fclose (fd );
1564
1572
return false;
1565
1573
}
@@ -1630,6 +1638,7 @@ process_builtin(char *tb)
1630
1638
commands = process_commands (buf );
1631
1639
if (commands == NULL )
1632
1640
{
1641
+ free (my_commands );
1633
1642
return NULL ;
1634
1643
}
1635
1644
You can’t perform that action at this time.
0 commit comments