From 6e3bcd40b7025d82b54f3899dbbb0122bfe5a727 Mon Sep 17 00:00:00 2001 From: Teemu Toivola Date: Tue, 25 Feb 2014 22:09:08 +0200 Subject: [PATCH] fix memory leak that occured in daemon when list of available interfaces was empty, fix debug print --- src/dbcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dbcache.c b/src/dbcache.c index a7f671b..9051bd9 100644 --- a/src/dbcache.c +++ b/src/dbcache.c @@ -123,7 +123,7 @@ int cacheupdate(void) } if (debug) { - printf("cache: %s added and updated (%d)\n", p->data.interface, p->filled); + printf("cache: %s added and updated (%d)\n", n->data.interface, n->filled); } return n->filled; @@ -268,6 +268,7 @@ uint32_t dbcheck(uint32_t dbhash, int *forcesave) /* get list of currently visible interfaces */ if (getiflist(&ifacelist)==0) { + free(ifacelist); return 0; } -- 2.40.0