Commit 6d594acb authored by pdw's avatar pdw

Fixed segfault / hang when specifying -i option twice.

parent 950623a9
......@@ -230,8 +230,13 @@ void config_set_string(const char *directive, const char* s) {
stringmap S;
S = stringmap_find(config, directive);
if (S) stringmap_delete_free(S);
stringmap_insert(config, directive, item_ptr(xstrdup(s)));
if (S) {
xfree(S->d.v);
S->d = item_ptr(xstrdup(s));
}
else {
stringmap_insert(config, directive, item_ptr(xstrdup(s)));
}
}
int read_config(char *file, int whinge_on_error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment