From: Steven Luo Date: Sat, 28 Aug 2010 11:22:50 +0000 (-0700) Subject: Make sure we don't try to free a random element of cfg in set_config_value() X-Git-Tag: v3.3b2~1 X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=commitdiff_plain;h=325ec40ff92a83af69506af0fc35944d2175575e;hp=31f999e769e441ace3a5f00a6a7583f4dc7b115c Make sure we don't try to free a random element of cfg in set_config_value() --- 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;