Skip to content

Commit d3fa9e7

Browse files
TianlongLianglum1n0us
authored andcommitted
fix potential memory leak (bytecodealliance#4205)
1 parent c193803 commit d3fa9e7

File tree

1 file changed

+2
-2
lines changed
  • core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src

1 file changed

+2
-2
lines changed

core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3031,9 +3031,9 @@ fd_table_destroy(struct fd_table *ft)
30313031
fd_object_release(NULL, ft->entries[i].object);
30323032
}
30333033
}
3034-
rwlock_destroy(&ft->lock);
30353034
wasm_runtime_free(ft->entries);
30363035
}
3036+
rwlock_destroy(&ft->lock);
30373037
}
30383038

30393039
void
@@ -3045,9 +3045,9 @@ fd_prestats_destroy(struct fd_prestats *pt)
30453045
wasm_runtime_free((void *)pt->prestats[i].dir);
30463046
}
30473047
}
3048-
rwlock_destroy(&pt->lock);
30493048
wasm_runtime_free(pt->prestats);
30503049
}
3050+
rwlock_destroy(&pt->lock);
30513051
}
30523052

30533053
bool

0 commit comments

Comments
 (0)