From: Teemu Toivola Date: Tue, 25 Feb 2014 20:09:08 +0000 (+0200) Subject: fix memory leak that occured in daemon when list of available interfaces was empty... X-Git-Tag: v1.12~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e3bcd40b7025d82b54f3899dbbb0122bfe5a727;p=vnstat fix memory leak that occured in daemon when list of available interfaces was empty, fix debug print --- 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; }