Check return value from archive_read_new().

Found with:	Coverity Prevent(tm)
CID:		8462
Reviewed by:	des
MFC after:	1 week
This commit is contained in:
Xin LI 2010-06-09 18:59:07 +00:00
parent bff23f82e5
commit d994242647
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208957

View File

@ -862,7 +862,9 @@ unzip(const char *fn)
if ((fd = open(fn, O_RDONLY)) < 0)
error("%s", fn);
a = archive_read_new();
if ((a = archive_read_new()) == NULL)
error("archive_read_new failed");
ac(archive_read_support_format_zip(a));
ac(archive_read_open_fd(a, fd, 8192));