Browse Source

tdb2: close memory leak in tdb_check()

Rusty Russell 15 years ago
parent
commit
71c1a95f1a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      ccan/tdb2/check.c

+ 4 - 0
ccan/tdb2/check.c

@@ -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;