libc-wasi: Fix a locking botch (#3437)

This commit is contained in:
YAMAMOTO Takashi 2024-05-15 16:41:40 +09:00 committed by GitHub
parent 7949df96f4
commit 51ecfd6673
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -650,8 +650,10 @@ fd_table_insert(wasm_exec_env_t exec_env, struct fd_table *ft,
__wasi_errno_t error = fd_table_unused(ft, out);
if (error != __WASI_ESUCCESS)
if (error != __WASI_ESUCCESS) {
rwlock_unlock(&ft->lock);
return error;
}
fd_table_attach(ft, *out, fo, rights_base, rights_inheriting);
rwlock_unlock(&ft->lock);