summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/pfctl/parse.y4
-rw-r--r--sbin/pfctl/pfctl.c6
-rw-r--r--sbin/pfctl/pfctl_optimize.c3
3 files changed, 9 insertions, 4 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index e3606d331f4..c49988a08a5 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.575 2009/11/22 22:34:50 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.576 2009/12/10 15:57:20 deraadt Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -5267,6 +5267,8 @@ pushfile(const char *name, int secret)
if ((nfile = calloc(1, sizeof(struct file))) == NULL ||
(nfile->name = strdup(name)) == NULL) {
+ if (nfile)
+ free(nfile);
warn("malloc");
return (NULL);
}
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index cab5c0b490b..84e3f0234a5 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.290 2009/11/22 22:34:50 henning Exp $ */
+/* $OpenBSD: pfctl.c,v 1.291 2009/12/10 15:57:20 deraadt Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1304,7 +1304,7 @@ pfctl_rules(int dev, char *filename, int opts, int optimize,
struct pfctl pf;
struct pf_ruleset *rs;
struct pfr_table trs;
- char *path;
+ char *path = NULL;
int osize;
RB_INIT(&pf_anchors);
@@ -1413,6 +1413,8 @@ _error:
err(1, "DIOCXROLLBACK");
exit(1);
} else { /* sub ruleset */
+ if (path)
+ free(path);
return (-1);
}
diff --git a/sbin/pfctl/pfctl_optimize.c b/sbin/pfctl/pfctl_optimize.c
index 6559ba44e38..4c6760b0d77 100644
--- a/sbin/pfctl/pfctl_optimize.c
+++ b/sbin/pfctl/pfctl_optimize.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_optimize.c,v 1.22 2009/11/23 21:29:21 henning Exp $ */
+/* $OpenBSD: pfctl_optimize.c,v 1.23 2009/12/10 15:57:20 deraadt Exp $ */
/*
* Copyright (c) 2004 Mike Frantzen <frantzen@openbsd.org>
@@ -914,6 +914,7 @@ load_feedback_profile(struct pfctl *pf, struct superblocks *superblocks)
pr.nr = nr;
if (ioctl(pf->dev, DIOCGETRULE, &pr)) {
warn("DIOCGETRULES");
+ free(por);
return (1);
}
memcpy(&por->por_rule, &pr.rule, sizeof(por->por_rule));