Error check strdup for path name

This commit is contained in:
AZero13 committed 2025-12-16 21:50:06 -05:00
1 parent b51e59bcfb
commit 50a67c9223
1 file changed
+2
+2
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;