diff --git a/src/core/expandos.c b/src/core/expandos.c index af175a12..45f6de18 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -144,8 +144,8 @@ void expando_destroy(const char *key, EXPANDO_FUNC func) } else if (g_hash_table_lookup_extended(expandos, key, &origkey, (gpointer *) &rec)) { if (rec->func == func) { - g_free(origkey); g_hash_table_remove(expandos, key); + g_free(origkey); g_free(rec); } } diff --git a/src/core/modules.c b/src/core/modules.c index b675b211..f450f39d 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -405,7 +405,7 @@ void module_unload(MODULE_REC *module) static void uniq_get_modules(char *key, void *value, GSList **list) { - *list = g_slist_append(*list, key); + *list = g_slist_append(*list, g_strdup(key)); } void modules_init(void) @@ -434,6 +434,7 @@ void modules_deinit(void) while (list != NULL) { module_uniq_destroy(list->data); + g_free(list->data); list = g_slist_remove(list, list->data); }