projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
083db3f
)
session: Fix two memory leaks.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 27 Jun 2013 05:56:16 +0000
(22:56 -0700)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 27 Jun 2013 05:56:16 +0000
(22:56 -0700)
Bug #39070.
src/data/session.c
patch
|
blob
|
history
diff --git
a/src/data/session.c
b/src/data/session.c
index 56aa31a91cd581036890e312c04bb83bdd30de5b..ae37c76b945c8ae9c69288313f69db41d5b24c15 100644
(file)
--- 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));