summaryrefslogtreecommitdiff
path: root/libpurple/protocols/gg/message-prpl.c
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2023-03-21 00:39:45 -0500
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2023-03-21 00:39:45 -0500
commit1b4f76976e1a069831b98518588f587be79b122c (patch)
tree0558873858c1d4b3fb27069c4932d729e3a7f397 /libpurple/protocols/gg/message-prpl.c
parentae674f38b973f59afa38f5fbcb8b4c069188e59f (diff)
downloadpidgin-1b4f76976e1a069831b98518588f587be79b122c.tar.gz
Use g_clear_* helpers where useful
That is: * when the variable is set to `NULL` right after freeing * when the variable is checked for non-`NULL` before freeing * when the variable is a global (because they should be set to `NULL`, even if we don't really claim that things can be re-init'd) Testing Done: Compiled, and ran tests in valgrind. Reviewed at https://reviews.imfreedom.org/r/2369/
Diffstat (limited to 'libpurple/protocols/gg/message-prpl.c')
-rw-r--r--libpurple/protocols/gg/message-prpl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libpurple/protocols/gg/message-prpl.c b/libpurple/protocols/gg/message-prpl.c
index f42084be71..e74c5a31b7 100644
--- a/libpurple/protocols/gg/message-prpl.c
+++ b/libpurple/protocols/gg/message-prpl.c
@@ -590,8 +590,7 @@ ggp_message_format_to_gg(PurpleConversation *conv, const gchar *text)
font_new->color = color;
}
- if (styles)
- g_hash_table_destroy(styles);
+ g_clear_pointer(&styles, g_hash_table_destroy);
g_hash_table_destroy(attribs);
}
else if ((tag == GGP_HTML_TAG_FONT || tag == GGP_HTML_TAG_SPAN