summaryrefslogtreecommitdiff
path: root/sbin/pfctl/parse.y
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/parse.y
parentea112d96b48a96b994250f5fb0cf81e876c314ec (diff)
plug some memory leaks; found by parfait, ok henning
Diffstat (limited to 'sbin/pfctl/parse.y')
-rw-r--r--sbin/pfctl/parse.y4
1 files changed, 3 insertions, 1 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);
}