From 290f6bbe4e651dc9bd4cea0f5f61985ce7f92703 Mon Sep 17 00:00:00 2001 From: tmeissner Date: Sat, 16 May 2015 22:53:02 +0200 Subject: [PATCH] fixed memory leak by adding free of in->pair array in dictionary_free() --- 21st_century_c/chapter11/dict.c | 1 + 1 file changed, 1 insertion(+) diff --git a/21st_century_c/chapter11/dict.c b/21st_century_c/chapter11/dict.c index abed088..aa43c97 100644 --- a/21st_century_c/chapter11/dict.c +++ b/21st_century_c/chapter11/dict.c @@ -78,6 +78,7 @@ void dictionary_free(dictionary *in) { for (size_t i = 0; i < in->length; i++) { keyval_free(in->pairs[i]); } + free(in->pairs); free(in); }