summaryrefslogtreecommitdiff
path: root/client/mysql_upgrade.c
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <cvicentiu@gmail.com>2016-02-14 18:33:20 +0200
committerVicențiu Ciorbaru <cvicentiu@gmail.com>2016-02-14 18:33:20 +0200
commit2a4781789612c6c53cbe12c1426f93b15737a148 (patch)
tree7df7ccbf97cd5ce809b3dd9dc7142ae7f6a66c32 /client/mysql_upgrade.c
parentb7dc830274d78cc191d7d29bcdd988dd10cd8c49 (diff)
downloadmariadb-git-2a4781789612c6c53cbe12c1426f93b15737a148.tar.gz
MDEV-9225 mysql_upgrade segfault due to missing /etc/my.cnf.d
In case of missing includedir file, we would attempt to free a NULL pointer. Make sure to guard against that.
Diffstat (limited to 'client/mysql_upgrade.c')
-rw-r--r--client/mysql_upgrade.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index bc9b3c5b149..8cfdac5b69a 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -182,7 +182,8 @@ static const char *load_default_groups[]=
static void free_used_memory(void)
{
/* Free memory allocated by 'load_defaults' */
- free_defaults(defaults_argv);
+ if (defaults_argv)
+ free_defaults(defaults_argv);
dynstr_free(&ds_args);
dynstr_free(&conn_args);