Skip to content

Commit

Permalink
Bug #17297012 MEMORY LEAK IN MYSQL_OPTIONS WHILE CALLING WITH OPTION …
Browse files Browse the repository at this point in the history
…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.
--BZR--
revision-id: igor.solodovnikov@oracle.com-20130830172209-5phr9u98x4za7czc
property-audit-revid: igor.solodovnikov@oracle.com-20130830172209-s9f8rz1mhfw9kmy0
property-branch-nick: mysql-5.5
testament3-sha1: 30a805fdc9c58a2bf110b2f8bbfef9b6898cab3b
  • Loading branch information
Igor Solodovnikov committed Aug 30, 2013
1 parent 801c1cb commit 5cc1c39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sql-common/client.c
Expand Up @@ -4151,6 +4151,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
mysql->options.methods_to_use= option;
break;
case MYSQL_SET_CLIENT_IP:
my_free(mysql->options.client_ip);
mysql->options.client_ip= my_strdup(arg, MYF(MY_WME));
break;
case MYSQL_SECURE_AUTH:
Expand Down

0 comments on commit 5cc1c39

Please sign in to comment.