From 2bbf289635aaa44fe05e2da0f48583c099080a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 24 Apr 2024 23:28:37 +0200 Subject: irc: remove check of NULL pointers before calling free() (issue #865) --- src/plugins/irc/irc-upgrade.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plugins/irc/irc-upgrade.c') 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 */ -- cgit v1.2.3