Commit 913f2296 authored by Igor Solodovnikov's avatar Igor Solodovnikov

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.
parent c53cad81
/* /*
Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -3167,6 +3167,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) ...@@ -3167,6 +3167,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
mysql->options.methods_to_use= option; mysql->options.methods_to_use= option;
break; break;
case MYSQL_SET_CLIENT_IP: case MYSQL_SET_CLIENT_IP:
my_free(mysql->options.client_ip,MYF(MY_ALLOW_ZERO_PTR));
mysql->options.client_ip= my_strdup(arg, MYF(MY_WME)); mysql->options.client_ip= my_strdup(arg, MYF(MY_WME));
break; break;
case MYSQL_SECURE_AUTH: case MYSQL_SECURE_AUTH:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment