Skip to content

Commit 319f5b3

Browse files
committed
memleak on parsing apk
1 parent c3f59f5 commit 319f5b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

zip/shadow_zip.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ static int parse_apk(const char* _path, std::vector<ZipEntry*>& _all_entries)
190190
return -1;
191191
}
192192
}
193+
delete[] buf;
194+
MY_LOG("got %zu entries[%u] in file %s", _all_entries.size(), (unsigned)sizeof(ZipEntry), _path);
193195
return 0;
194196
}
195197

@@ -512,6 +514,7 @@ off64_t ShadowZip::fseek(FILE *stream, off64_t offset, int whence)
512514
}
513515
if (pos_ < 0 || pos_ > end_of_file_){
514516
pos_ = cur_pos;
517+
MY_ERROR("fseek failed: pos:0x%08llx, end_of_file:0x%08llx", (unsigned long long)pos_, (unsigned long long)end_of_file_);
515518
return -1;
516519
}
517520
return 0;

0 commit comments

Comments
 (0)