Fix use after free in wasi.cpp found by AddressSanitizer

This commit is contained in:
刘皓 2025-02-17 00:07:54 -05:00
parent cae4166765
commit decb4236bd
No known key found for this signature in database
GPG key ID: 7901753DB465B711

View file

@ -109,11 +109,10 @@ wasi_zip_container::wasi_zip_container(const void *buffer, zip_uint64_t length,
wasi_zip_container::~wasi_zip_container() {
if (zip != NULL) {
zip_close(zip);
if (source != NULL) {
} else if (source != NULL) {
zip_source_close(source);
}
}
}
wasi_zip_file_container::wasi_zip_file_container() : file(NULL) {}