diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-03 22:06:08 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-03 22:06:08 +0100 |
commit | e8df46c0050d6d2d1f9e1eb35a59d379636fb48c (patch) | |
tree | 2b4a6e3711167c77c81765afd9eb05954a521974 | |
parent | 3d8553316f391e62ab6982b3e16889351b8f525d (diff) | |
download | weechat-e8df46c0050d6d2d1f9e1eb35a59d379636fb48c.zip |
Fix crash when setting wrong value in option irc.server.xxx.sasl_mechanism (bug #32670)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/core/wee-config-file.c | 16 |
2 files changed, 19 insertions, 1 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.3.5-dev, 2011-03-02 +v0.3.5-dev, 2011-03-03 Version 0.3.5 (under dev!) @@ -28,6 +28,8 @@ Version 0.3.5 (under dev!) * core: dynamically allocate color pairs (extended colors can be used without being added with command "/color") * core: allow background for nick colors (using ":") +* irc: fix crash when setting wrong value in option + irc.server.xxx.sasl_mechanism (bug #32670) * irc: add new option irc.look.color_nicks_in_nicklist * irc: fix crash when completing /part command on a non-irc buffer (bug #32402) * irc: add many missing commands for target buffer (options irc.msgbuffer.xxx) diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 6fb707de4..aea260fca 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -1177,6 +1177,14 @@ config_file_option_set (struct t_config_option *option, const char *value, else rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; } + else + { + if (old_value_was_null) + { + free (option->value); + option->value = NULL; + } + } } else { @@ -1226,6 +1234,14 @@ config_file_option_set (struct t_config_option *option, const char *value, else rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE; } + else + { + if (old_value_was_null) + { + free (option->value); + option->value = NULL; + } + } } } break; |