]> git.ipfire.org Git - thirdparty/libarchive.git/commit
fix dereferencing null pointer in file_new()
authorPatrick Cheng <patcheng@users.noreply.github.com>
Sun, 24 Feb 2019 19:32:06 +0000 (11:32 -0800)
committerMartin Matuška <martin@matuska.org>
Sun, 24 Feb 2019 19:32:06 +0000 (20:32 +0100)
commit57742aa0df9b4dbef6532a1b8393056ae4d798bc
tree53e58cd46ac7ff62abbd013e5970fdf60cd2436f
parent2c65d83fa2dba8861e8ae0e1bebe771ad2d478a2
fix dereferencing null pointer in file_new()

file_new() sets file to NULL first.
when file_new() fails, file is set to NULL if it doesn't need to be freed
so, only free when need to. otherwise would deference a null pointer.

Found this from clang's analyzer
Fixes #1140
libarchive/archive_write_set_format_7zip.c