Commit 40bab4d5 authored by Rusty Russell's avatar Rusty Russell

tdb2: fix use after free on error message

We use "r" after we call tdb_access_release() when we find corruption
in the free list.  "r" may be a pointer into malloced memory, freed
by tdb_access_release().
parent e1fd1d96
......@@ -457,12 +457,12 @@ again:
}
if (frec_magic(r) != TDB_FREE_MAGIC) {
tdb_access_release(tdb, r);
ecode = tdb_logerr(tdb, TDB_ERR_CORRUPT, TDB_LOG_ERROR,
"lock_and_alloc:"
" %llu non-free 0x%llx",
(long long)off,
(long long)r->magic_and_prev);
tdb_access_release(tdb, r);
goto unlock_err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment