Make sure we don't try to free a random element of cfg in set_config_value()
authorSteven Luo <steven+maemo@steven676.net>
Sat, 28 Aug 2010 11:22:50 +0000 (04:22 -0700)
committerSteven Luo <steven+maemo@steven676.net>
Sat, 28 Aug 2010 11:22:50 +0000 (04:22 -0700)
config-ui/browser-switchboard-config.c

index 948952f..c28b743 100644 (file)
@@ -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;