diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-24 23:28:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-04-25 20:59:24 +0200 |
commit | 2bbf289635aaa44fe05e2da0f48583c099080a34 (patch) | |
tree | 72deb215d0fb87bc860d1a104bc2e0a145309efa /src/plugins/irc/irc-upgrade.c | |
parent | f3a9bfe55e7f7a574681a695d3ba99455feb08ed (diff) | |
download | weechat-2bbf289635aaa44fe05e2da0f48583c099080a34.zip |
irc: remove check of NULL pointers before calling free() (issue #865)
Diffstat (limited to 'src/plugins/irc/irc-upgrade.c')
-rw-r--r-- | src/plugins/irc/irc-upgrade.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-upgrade.c b/src/plugins/irc/irc-upgrade.c index 4a82af10f..1ada7fa6d 100644 --- a/src/plugins/irc/irc-upgrade.c +++ b/src/plugins/irc/irc-upgrade.c @@ -500,16 +500,14 @@ irc_upgrade_read_cb (const void *pointer, void *data, str = weechat_infolist_string (infolist, "prefix_modes"); if (str) { - if (irc_upgrade_current_server->prefix_modes) - free (irc_upgrade_current_server->prefix_modes); + free (irc_upgrade_current_server->prefix_modes); irc_upgrade_current_server->prefix_modes = strdup (str); } /* "prefix_chars" is new in WeeChat 0.3.4 */ str = weechat_infolist_string (infolist, "prefix_chars"); if (str) { - if (irc_upgrade_current_server->prefix_chars) - free (irc_upgrade_current_server->prefix_chars); + free (irc_upgrade_current_server->prefix_chars); irc_upgrade_current_server->prefix_chars = strdup (str); } /* "msg_max_length" is new in WeeChat 4.0.0 */ |