Fix a 1-byte memory leak in caps_generate()
The caps value is correctly stolen and reinserted but the previous
hash key should be freed. This is a special key "" of 1 byte.
--- a/mcabber/mcabber/caps.c Thu Nov 05 23:34:23 2015 +0100
+++ b/mcabber/mcabber/caps.c Fri Nov 06 13:43:15 2015 +0100
@@ -280,10 +280,15 @@
guint8 digest[20];
gsize digest_size = 20;
gchar *hash, *old_hash = NULL;
- caps *old_caps;
- caps *c = g_hash_table_lookup(caps_cache, "");
+ caps *old_caps, *c;
+ gpointer key;
+
+ if (!g_hash_table_lookup_extended(caps_cache, "", &key, &c))
+ return NULL;
g_hash_table_steal(caps_cache, "");
+ g_free(key);
+
sha1 = g_checksum_new(G_CHECKSUM_SHA1);
langs = g_hash_table_get_keys(c->identities);