From a10396710e32659e82032b84a5468be52c3996d5 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 19 Mar 2011 20:39:01 +0100 Subject: [PATCH] flose files & free memory when not needed Fixes to issues found with valgrind. Signed-off-by: Sami Kerola --- src/getdata.c | 2 ++ src/other.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/getdata.c b/src/getdata.c index 7fbe4d0..c25d87e 100644 --- a/src/getdata.c +++ b/src/getdata.c @@ -163,6 +163,7 @@ int parse_leases(void) if (macaddr != NULL) { free(macstring); } + fclose(dhcpd_leases); return 0; } @@ -452,5 +453,6 @@ char *parse_config(int is_include, char *config_file, } } free(word); + fclose(dhcpd_config); return next_free_shared_name; } diff --git a/src/other.c b/src/other.c index 42f86ca..fe5f34c 100644 --- a/src/other.c +++ b/src/other.c @@ -94,6 +94,8 @@ void clean_up(void) free(config.dhcpdlease_file); free(config.output_file); free(ranges); + free(leases); + free(touches); free(shared_net_names); free(shared_networks); } -- 1.7.10.4