mirror of
https://github.com/libarchive/libarchive.git
synced 2026-01-26 15:39:09 +00:00
Merge pull request #2816 from AZero13/strdup
Error check strdup for path name (cherry picked from commit 095609e89bbea9a59e4c1405fb3f360db316c52e)
This commit is contained in:
parent
2d0d2311d3
commit
bec0337316
@ -64,6 +64,8 @@ lafe_line_reader(const char *pathname, int nullSeparator)
|
||||
|
||||
lr->nullSeparator = nullSeparator;
|
||||
lr->pathname = strdup(pathname);
|
||||
if (lr->pathname == NULL)
|
||||
lafe_errc(1, ENOMEM, "Can't open %s", pathname);
|
||||
|
||||
if (strcmp(pathname, "-") == 0)
|
||||
lr->f = stdin;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user