0
0
mirror of https://github.com/libarchive/libarchive.git synced 2026-01-18 17:11:25 +01:00

Merge pull request #2816 from AZero13/strdup

Error check strdup for path name
This commit is contained in:
Martin Matuška
2025-12-25 10:14:23 +01:00
committed by GitHub

View File

@@ -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;