Skip to content

Commit 938e370

Browse files
author
Igor Solodovnikov
committed
Bug #17297012 MEMORY LEAK IN MYSQL_OPTIONS WHILE CALLING WITH OPTION MYSQL_SET_CLIENT_IP
Memory Leak in mysql_options() was caused by missing call to my_free() in MYSQL_SET_CLIENT_IP branch. Fixed by adding my_free() to cleanup mysql->options.client_ip value before assigning new value.
1 parent a8ea4ee commit 938e370

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

sql-common/client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4390,6 +4390,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
43904390
mysql->options.methods_to_use= option;
43914391
break;
43924392
case MYSQL_SET_CLIENT_IP:
4393+
my_free(mysql->options.ci.client_ip);
43934394
mysql->options.ci.client_ip= my_strdup(arg, MYF(MY_WME));
43944395
break;
43954396
case MYSQL_SECURE_AUTH:

0 commit comments

Comments
 (0)