summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-12-10 15:57:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-12-10 15:57:21 +0000
commitba451d4d33bde0a4f9ae8e07b0c3fecc3a7f92b2 (patch)
treede37613f9c0f0dd3aa9d69eb447d7140b927223f /sbin/pfctl/pfctl.c
parentea112d96b48a96b994250f5fb0cf81e876c314ec (diff)
plug some memory leaks; found by parfait, ok henning
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c6
1 files changed, 4 insertions, 2 deletions
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);
}