From 325ec40ff92a83af69506af0fc35944d2175575e Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Sat, 28 Aug 2010 04:22:50 -0700 Subject: [PATCH] Make sure we don't try to free a random element of cfg in set_config_value() --- config-ui/browser-switchboard-config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-ui/browser-switchboard-config.c b/config-ui/browser-switchboard-config.c index 948952f..c28b743 100644 --- a/config-ui/browser-switchboard-config.c +++ b/config-ui/browser-switchboard-config.c @@ -163,7 +163,7 @@ static int set_config_value(char *name, char *value) { /* XXX can't free all of cfg, it contains pointers to memory we just freed above swb_config_free(&cfg); */ - if (optinfo->type == SWB_CONFIG_OPT_STRING) + if (optinfo->name && optinfo->type == SWB_CONFIG_OPT_STRING) free(*(char **)cfg.entries[i]); return retval; -- 1.7.9.5