Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/caps.c @ 2212:778280b01bcb
Fix a few memory leaks
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 05 Nov 2015 15:08:47 +0100 |
parents | 01485f807811 |
children | fa516ef22145 |
comparison
equal
deleted
inserted
replaced
2211:902f271743b0 | 2212:778280b01bcb |
---|---|
99 return; | 99 return; |
100 caps *c = g_new0(caps, 1); | 100 caps *c = g_new0(caps, 1); |
101 c->features = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); | 101 c->features = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
102 c->identities = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, identity_destroy); | 102 c->identities = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, identity_destroy); |
103 c->forms = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, form_destroy); | 103 c->forms = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, form_destroy); |
104 g_hash_table_insert(caps_cache, g_strdup(hash), c); | 104 g_hash_table_replace(caps_cache, g_strdup(hash), c); |
105 } | 105 } |
106 | 106 |
107 void caps_remove(const char *hash) | 107 void caps_remove(const char *hash) |
108 { | 108 { |
109 if (!hash) | 109 if (!hash) |