diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-10-22 16:35:34 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-10-22 16:35:34 +0000 |
commit | 3496e376ffc77a55e8ede0a03f7572807a90cb78 (patch) | |
tree | 5f523a1948846f5bbdadf4172df33947e345a216 /sbin/ipsecctl/parse.y | |
parent | 0d05ede87a3c4d7d603d92ffaa020d36f47df942 (diff) |
sync with daemon parser code.
ok deraadt@
Diffstat (limited to 'sbin/ipsecctl/parse.y')
-rw-r--r-- | sbin/ipsecctl/parse.y | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y index c46d0c8342d..c826fa21686 100644 --- a/sbin/ipsecctl/parse.y +++ b/sbin/ipsecctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.130 2007/10/16 20:01:23 mpf Exp $ */ +/* $OpenBSD: parse.y,v 1.131 2007/10/22 16:35:33 pyr Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1184,16 +1184,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); @@ -1235,7 +1239,6 @@ parse_rules(const char *filename, struct ipsecctl *ipsecx) ipsec = ipsecx; if ((file = pushfile(filename, 1)) == NULL) { - warn("cannot open the main config file!"); return (-1); } |