summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorIgor Solodovnikov <igor.solodovnikov@oracle.com>2013-08-30 20:05:37 +0300
committerIgor Solodovnikov <igor.solodovnikov@oracle.com>2013-08-30 20:05:37 +0300
commit28959a5661d14de784ab8b369613511727200811 (patch)
tree54afa80b172155cd81de5b2d03c45332ccf0917f /sql-common
parent881e61db72e568ef0b55bc36d710c650abccfa85 (diff)
downloadmariadb-git-28959a5661d14de784ab8b369613511727200811.tar.gz
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.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 51911d913c7..7ee0eabe0ef 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,5 +1,5 @@
/*
- 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
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)
mysql->options.methods_to_use= option;
break;
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));
break;
case MYSQL_SECURE_AUTH: