Skip to content

Commit 730fb28

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 7ae6269 commit 730fb28

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sql-common/client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4151,6 +4151,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
41514151
mysql->options.methods_to_use= option;
41524152
break;
41534153
case MYSQL_SET_CLIENT_IP:
4154+
my_free(mysql->options.client_ip);
41544155
mysql->options.client_ip= my_strdup(arg, MYF(MY_WME));
41554156
break;
41564157
case MYSQL_SECURE_AUTH:

0 commit comments

Comments
 (0)