Fixed segfault / hang when specifying -i option twice.
This commit is contained in:
@@ -230,8 +230,13 @@ void config_set_string(const char *directive, const char* s) {
|
|||||||
stringmap S;
|
stringmap S;
|
||||||
|
|
||||||
S = stringmap_find(config, directive);
|
S = stringmap_find(config, directive);
|
||||||
if (S) stringmap_delete_free(S);
|
if (S) {
|
||||||
stringmap_insert(config, directive, item_ptr(xstrdup(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) {
|
int read_config(char *file, int whinge_on_error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user