projects
/
browser-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
addb0ed
)
Fix memory leak when repeated options are encountered in config file
author
Steven Luo
<steven+maemo@steven676.net>
Thu, 26 Aug 2010 11:43:15 +0000
(
04:43
-0700)
committer
Steven Luo
<steven+maemo@steven676.net>
Thu, 26 Aug 2010 11:43:15 +0000
(
04:43
-0700)
Caught by valgrind.
config.c
patch
|
blob
|
history
diff --git
a/config.c
b/config.c
index
8928a3d
..
395bcf2
100644
(file)
--- a/
config.c
+++ b/
config.c
@@
-119,6
+119,10
@@
static int swb_config_load_option(struct swb_config *cfg,
break;
}
cfg->flags |= opt->set_mask;
+ } else {
+ /* Option was repeated in the config file
+ We want the first value, so ignore this one */
+ free(value);
}
retval = 1;
break;