]> granicus.if.org Git - vnstat/commitdiff
fix memory leak that occured in daemon when list of available interfaces was empty...
authorTeemu Toivola <git@humdi.net>
Tue, 25 Feb 2014 20:09:08 +0000 (22:09 +0200)
committerTeemu Toivola <git@humdi.net>
Tue, 25 Feb 2014 20:09:08 +0000 (22:09 +0200)
src/dbcache.c

index a7f671bd566d31e1e8451cefc20dae89f0e728e2..9051bd98bf1346ace4c78171cec7468e3ba935aa 100644 (file)
@@ -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;
        }