]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/test/run-15-append.c
tdb2: rework free.c functions to return enum TDB_ERROR.
[ccan] / ccan / tdb2 / test / run-15-append.c
index fe7a24e0eb402767891a7705d58b9c0a0a2113c8..36b6162fbd0802e783c6611be8fdaf081ee90661 100644 (file)
@@ -19,7 +19,7 @@ static tdb_off_t tdb_offset(struct tdb_context *tdb, struct tdb_data key)
        struct hash_info h;
 
        off = find_and_lock(tdb, key, F_RDLCK, &h, &rec, NULL);
-       if (unlikely(off == TDB_OFF_ERR))
+       if (TDB_OFF_IS_ERR(off))
                return 0;
        tdb_unlock_hashes(tdb, h.hlock_start, h.hlock_range, F_RDLCK);
        return off;
@@ -126,5 +126,6 @@ int main(int argc, char *argv[])
        }
 
        ok1(tap_log_messages == 0);
+       free(buffer);
        return exit_status();
 }