g_free() to auto_gfree, introduce auto_guchar

Fix 11 potential mem leaks in theme.c
This commit is contained in:
John Hernandez
2023-07-13 17:04:59 +02:00
parent 3a4cd7da48
commit 8304ac86ff
39 changed files with 145 additions and 233 deletions

View File

@@ -268,7 +268,7 @@ roster_result_handler(xmpp_stanza_t* const stanza)
while (item) {
const char* barejid = xmpp_stanza_get_attribute(item, STANZA_ATTR_JID);
gchar* barejid_lower = g_utf8_strdown(barejid, -1);
auto_gchar gchar* barejid_lower = g_utf8_strdown(barejid, -1);
const char* name = xmpp_stanza_get_attribute(item, STANZA_ATTR_NAME);
const char* sub = xmpp_stanza_get_attribute(item, STANZA_ATTR_SUBSCRIPTION);
@@ -289,7 +289,6 @@ roster_result_handler(xmpp_stanza_t* const stanza)
log_warning("Attempt to add contact twice: %s", barejid_lower);
}
g_free(barejid_lower);
item = xmpp_stanza_get_next(item);
}