android_system_core/libsparse
Robin Hsu 48c9f6196f libsparse: fix memory leak in output_file_close()
Fix memory leak in output_file_close():
Arguable whose resposibility to free structs allocated inside a file
struct (the caller or the library function), but the following protocol
(i.e. this fix) would better prevent memory leaks:
1) output_file_close() function will free those structs inside a file struct,
   right before closing the file.
   * Note: those structs are originally allocated by other libsparse function.
2) If the caller wants to clean up those struct inside a file struct,
   it may.  Just free those structs, and set the pointer to NULL.
   Afterward, when file_close()'s are called, they won't be free'ed twice.

Bug: 142483439
Test: verified by script MemLeak_LastCmd.sh (attached in Bugnizer)
Change-Id: I8bb9f7c9f7d19268663e2830d1a90d27bd5f99bd
Signed-off-by: Robin Hsu <robinhsu@google.com>
2019-11-12 18:52:29 +08:00
..
include/sparse
.clang-format
Android.bp Add fuzzer for libsparse 2019-09-25 13:27:52 -07:00
OWNERS
append2simg.cpp
backed_block.cpp
backed_block.h
defs.h
img2simg.cpp
output_file.cpp libsparse: fix memory leak in output_file_close() 2019-11-12 18:52:29 +08:00
output_file.h
simg2img.cpp
simg2simg.cpp
simg_dump.py
sparse.cpp Fix an unintialized return value. 2019-05-02 12:54:09 -07:00
sparse_crc32.cpp
sparse_crc32.h
sparse_defs.h
sparse_err.cpp
sparse_file.h
sparse_format.h
sparse_fuzzer.cpp Add fuzzer for libsparse 2019-09-25 13:27:52 -07:00
sparse_read.cpp