Browse Source

tdb2: fix leak on lock failure during open.

Rusty Russell 15 years ago
parent
commit
a2083afe4b
1 changed files with 1 additions and 0 deletions
  1. 1 0
      ccan/tdb2/tdb.c

+ 1 - 0
ccan/tdb2/tdb.c

@@ -397,6 +397,7 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags,
 		} else
 			tdb_munmap(tdb);
 	}
+	free(tdb->lockrecs);
 	free((char *)tdb->name);
 	if (tdb->fd != -1)
 		if (close(tdb->fd) != 0)