X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb2%2Fopen.c;h=7bb50f1db5964ae13687f0c792fab5a8603e8481;hb=94c8763345a51fe59e97daf4e29051f56331c63c;hp=9aaa218a29c03153e26db7c774a81389bac2c3aa;hpb=f6067e4cbd7b7415571f12438aec00faec5657fb;p=ccan diff --git a/ccan/tdb2/open.c b/ccan/tdb2/open.c index 9aaa218a..7bb50f1d 100644 --- a/ccan/tdb2/open.c +++ b/ccan/tdb2/open.c @@ -454,9 +454,9 @@ fail_errno: #ifdef TDB_TRACE close(tdb->tracefd); #endif - free((char *)tdb->name); + free(cast_const(char *, tdb->name)); if (tdb->file) { - tdb_unlock_all(tdb); + tdb_lock_cleanup(tdb); if (--tdb->file->refcnt == 0) { assert(tdb->file->num_lockrecs == 0); if (tdb->file->map_ptr) { @@ -495,11 +495,11 @@ int tdb_close(struct tdb_context *tdb) else tdb_munmap(tdb->file); } - free((char *)tdb->name); + free(cast_const(char *, tdb->name)); if (tdb->file) { struct tdb_file **i; - tdb_unlock_all(tdb); + tdb_lock_cleanup(tdb); if (--tdb->file->refcnt == 0) { ret = close(tdb->file->fd);