fix potential memory leak (#4205)

This commit is contained in:
TianlongLiang 2025-04-22 12:08:25 +08:00 committed by GitHub
parent 8f8c5605e9
commit ff2768775c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3021,9 +3021,9 @@ fd_table_destroy(struct fd_table *ft)
fd_object_release(NULL, ft->entries[i].object); fd_object_release(NULL, ft->entries[i].object);
} }
} }
rwlock_destroy(&ft->lock);
wasm_runtime_free(ft->entries); wasm_runtime_free(ft->entries);
} }
rwlock_destroy(&ft->lock);
} }
void void
@ -3035,9 +3035,9 @@ fd_prestats_destroy(struct fd_prestats *pt)
wasm_runtime_free((void *)pt->prestats[i].dir); wasm_runtime_free((void *)pt->prestats[i].dir);
} }
} }
rwlock_destroy(&pt->lock);
wasm_runtime_free(pt->prestats); wasm_runtime_free(pt->prestats);
} }
rwlock_destroy(&pt->lock);
} }
bool bool