summaryrefslogtreecommitdiff
path: root/sbin/pfctl/parse.y
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-10-22 16:35:34 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-10-22 16:35:34 +0000
commit3496e376ffc77a55e8ede0a03f7572807a90cb78 (patch)
tree5f523a1948846f5bbdadf4172df33947e345a216 /sbin/pfctl/parse.y
parent0d05ede87a3c4d7d603d92ffaa020d36f47df942 (diff)
sync with daemon parser code.
ok deraadt@
Diffstat (limited to 'sbin/pfctl/parse.y')
-rw-r--r--sbin/pfctl/parse.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 1416f12aeb9..e5375f5cfb6 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.531 2007/10/22 00:40:46 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.532 2007/10/22 16:35:33 pyr Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -5461,16 +5461,20 @@ pushfile(const char *name, int secret)
struct file *nfile;
if ((nfile = calloc(1, sizeof(struct file))) == NULL ||
- (nfile->name = strdup(name)) == NULL)
+ (nfile->name = strdup(name)) == NULL) {
+ warn("malloc");
return (NULL);
+ }
if (TAILQ_FIRST(&files) == NULL && strcmp(nfile->name, "-") == 0) {
nfile->stream = stdin;
free(nfile->name);
if ((nfile->name = strdup("stdin")) == NULL) {
+ warn("strdup");
free(nfile);
return (NULL);
}
} else if ((nfile->stream = fopen(nfile->name, "r")) == NULL) {
+ warn("%s", nfile->name);
free(nfile->name);
free(nfile);
return (NULL);