Skip to content

Commit 4aa6a44

Browse files
committed
Fix missing lock release in exqlite_deserialize on malloc failure
When sqlite3_malloc fails, the function returned without calling connection_release_lock, leaving the connection permanently locked. Any subsequent call on that connection would deadlock indefinitely.
1 parent 82ca950 commit 4aa6a44

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

c_src/sqlite3_nif.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ exqlite_deserialize(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
10551055
size = serialized.size;
10561056
buffer = sqlite3_malloc(size);
10571057
if (!buffer) {
1058+
connection_release_lock(conn);
10581059
return make_error_tuple(env, am_deserialization_failed);
10591060
}
10601061

0 commit comments

Comments
 (0)