summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl_parser.c
diff options
context:
space:
mode:
authorzinovik <zinovik@cvs.openbsd.org>2010-05-16 12:23:31 +0000
committerzinovik <zinovik@cvs.openbsd.org>2010-05-16 12:23:31 +0000
commitf0369103f536fc1d4f3ca5b32f80f269674ad799 (patch)
treefdb39ec38dc9c53287495f5a4d24e96c1468bbdd /sbin/pfctl/pfctl_parser.c
parent0222ee68ab1463461c21e5c367319c850b388b9b (diff)
plug memory leak. `ps' was allocated with strdup(3), but on error path
program does not free(3) it.
Diffstat (limited to 'sbin/pfctl/pfctl_parser.c')
-rw-r--r--sbin/pfctl/pfctl_parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 648a82b5475..0d59d25a339 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_parser.c,v 1.264 2010/03/22 17:04:02 deraadt Exp $ */
+/* $OpenBSD: pfctl_parser.c,v 1.265 2010/05/16 12:23:30 zinovik Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1449,6 +1449,7 @@ host(const char *s)
mask = strtol(p+1, &q, 0);
if (!q || *q || mask > 128 || q == (p+1)) {
free(r);
+ free(ps);
fprintf(stderr, "invalid netmask '%s'\n", p);
return (NULL);
}