From 0755b9a4256554906377f2db62e25ac09255a790 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 26 Jun 2013 22:56:16 -0700 Subject: [PATCH] session: Fix two memory leaks. Bug #39070. --- src/data/session.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data/session.c b/src/data/session.c index 56aa31a91c..ae37c76b94 100644 --- a/src/data/session.c +++ b/src/data/session.c @@ -69,6 +69,7 @@ session_destroy (struct session *s) s->active = NULL; HMAPX_FOR_EACH_SAFE (ds, node, next, &s->datasets) dataset_destroy (ds); + hmapx_destroy (&s->datasets); free (s->syntax_encoding); free (s); } @@ -96,7 +97,10 @@ session_add_dataset (struct session *s, struct dataset *ds) if (old == s->active) s->active = ds; if (old != NULL) - session_remove_dataset (s, old); + { + session_remove_dataset (s, old); + dataset_destroy (old); + } hmapx_insert (&s->datasets, ds, utf8_hash_case_string (dataset_name (ds), 0)); -- 2.30.2