projects
/
browser-switch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure we don't try to free a random element of cfg in set_config_value()
[browser-switch]
/
config-ui
/
browser-switchboard-config.c
diff --git
a/config-ui/browser-switchboard-config.c
b/config-ui/browser-switchboard-config.c
index
948952f
..
c28b743
100644
(file)
--- 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); */
/* 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;
free(*(char **)cfg.entries[i]);
return retval;