Skip to content

Commit ff27687

Browse files
fix potential memory leak (#4205)
1 parent 8f8c560 commit ff27687

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
@@ -3021,9 +3021,9 @@ fd_table_destroy(struct fd_table *ft)
30213021
fd_object_release(NULL, ft->entries[i].object);
30223022
}
30233023
}
3024-
rwlock_destroy(&ft->lock);
30253024
wasm_runtime_free(ft->entries);
30263025
}
3026+
rwlock_destroy(&ft->lock);
30273027
}
30283028

30293029
void
@@ -3035,9 +3035,9 @@ fd_prestats_destroy(struct fd_prestats *pt)
30353035
wasm_runtime_free((void *)pt->prestats[i].dir);
30363036
}
30373037
}
3038-
rwlock_destroy(&pt->lock);
30393038
wasm_runtime_free(pt->prestats);
30403039
}
3040+
rwlock_destroy(&pt->lock);
30413041
}
30423042

30433043
bool

0 commit comments

Comments
 (0)