summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-tag.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-04-24 23:28:37 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-04-25 20:59:24 +0200
commit2bbf289635aaa44fe05e2da0f48583c099080a34 (patch)
tree72deb215d0fb87bc860d1a104bc2e0a145309efa /src/plugins/irc/irc-tag.c
parentf3a9bfe55e7f7a574681a695d3ba99455feb08ed (diff)
downloadweechat-2bbf289635aaa44fe05e2da0f48583c099080a34.zip
irc: remove check of NULL pointers before calling free() (issue #865)
Diffstat (limited to 'src/plugins/irc/irc-tag.c')
-rw-r--r--src/plugins/irc/irc-tag.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-tag.c b/src/plugins/irc/irc-tag.c
index 5d3d06c82..4ec61dea0 100644
--- a/src/plugins/irc/irc-tag.c
+++ b/src/plugins/irc/irc-tag.c
@@ -261,8 +261,7 @@ irc_tag_parse (const char *tags,
key);
unescaped = irc_tag_unescape_value (pos + 1);
weechat_hashtable_set (hashtable, str_key, unescaped);
- if (unescaped)
- free (unescaped);
+ free (unescaped);
free (key);
num_tags++;
}
@@ -314,8 +313,7 @@ irc_tag_add_to_string_cb (void *data,
weechat_string_dyn_concat (string,
(escaped) ? escaped : (const char *)value,
-1);
- if (escaped)
- free (escaped);
+ free (escaped);
}
}
@@ -430,12 +428,10 @@ irc_tag_add_tags_to_message (const char *message, struct t_hashtable *tags)
weechat_string_dyn_concat (result, ptr_message, -1);
end:
- if (msg_str_tags)
- free (msg_str_tags);
+ free (msg_str_tags);
if (msg_hash_tags)
weechat_hashtable_free (msg_hash_tags);
- if (new_tags)
- free (new_tags);
+ free (new_tags);
return (result) ? weechat_string_dyn_free (result, 0) : NULL;
}