tdb2: fix leak on lock failure during open.
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/tdb.c

index fa890ec8be9f25d7bb515b14c9280c871e6a683d..def2642e5560b84d059cb14e8c6542adc5e76585 100644 (file)
@@ -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)