Fix memleak in dbdiff and add boolean api