Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/caps.c @ 2223:965e0282c128
Backed out changeset fa516ef22145
Turns out that in this hash the value pointer is the same as the
key pointer, so there's no need to free both the key and the value.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 06 Nov 2015 22:31:40 +0100 |
parents | 3f9988ec21e0 |
children | f5402d705f67 |
comparison
equal
deleted
inserted
replaced
2222:ce1043326bbc | 2223:965e0282c128 |
---|---|
96 void caps_add(const char *hash) | 96 void caps_add(const char *hash) |
97 { | 97 { |
98 if (!hash) | 98 if (!hash) |
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, g_free); | 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_replace(caps_cache, g_strdup(hash), c); | 104 g_hash_table_replace(caps_cache, g_strdup(hash), c); |
105 } | 105 } |
106 | 106 |