diff options
author | pdw <> | 2010-11-27 10:34:31 +0000 |
---|---|---|
committer | pdw <> | 2010-11-27 10:34:31 +0000 |
commit | 6d594acbd60ce301085ceb59d0981eba2cdaaf14 (patch) | |
tree | 7a436bee90aaad0a7fb216e62fc12524addcbb28 | |
parent | 950623a9d15ab27963f165bd2ea8a9a57bfb775c (diff) | |
download | iftop-6d594acbd60ce301085ceb59d0981eba2cdaaf14.zip |
Fixed segfault / hang when specifying -i option twice.
-rw-r--r-- | cfgfile.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) { |