Hello! There is the following comment in sqlite3.h: <code> ** If sqlite3_deserialize(D,S,P,N,M,F) fails for any reason and if the ** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then ** [sqlite3_free()] is invoked on argument P prior to returning. <code> But this is not true - the only usage of pData is on the line: <code> p->aData = pData; <code> Just before the successful exit, so the memory block is never freed on the function fail