tdb2: close memory leak in tdb_check()
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
ccan/tdb2/check.c

index 4da81dbbbb53fa68ab1031fabaaccbc95f3dca2a..df61184f60822fd0dac8af95a16897f28fb3a772 100644 (file)
@@ -700,9 +700,13 @@ int tdb_check(struct tdb_context *tdb,
 
        tdb_allrecord_unlock(tdb, F_RDLCK);
        tdb_unlock_expand(tdb, F_RDLCK);
+       free(fr);
+       free(used);
        return 0;
 
 fail:
+       free(fr);
+       free(used);
        tdb_allrecord_unlock(tdb, F_RDLCK);
        tdb_unlock_expand(tdb, F_RDLCK);
        return -1;