tdb2: cancel transactions on tdb_close
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 13:18:42 +0000 (23:48 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 13:18:42 +0000 (23:48 +1030)
Otherwise we leak memory.

ccan/tdb2/tdb.c

index d070a0ef3068210d1d828731a1361716557f476e..8bae9fc298516738f3e896aa4c31edfa7350f893 100644 (file)
@@ -602,12 +602,11 @@ int tdb_close(struct tdb_context *tdb)
        struct tdb_context **i;
        int ret = 0;
 
        struct tdb_context **i;
        int ret = 0;
 
-       /* FIXME:
+       tdb_trace(tdb, "tdb_close");
+
        if (tdb->transaction) {
                tdb_transaction_cancel(tdb);
        }
        if (tdb->transaction) {
                tdb_transaction_cancel(tdb);
        }
-       */
-       tdb_trace(tdb, "tdb_close");
 
        if (tdb->map_ptr) {
                if (tdb->flags & TDB_INTERNAL)
 
        if (tdb->map_ptr) {
                if (tdb->flags & TDB_INTERNAL)