From 1ea287946b9b4365ed4a24762f35732c4283b716 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Wed, 13 Jan 2010 01:41:59 +0000 Subject: fix some leaks found by parfait ok mcbride@ henning@ --- sbin/pfctl/pfctl.c | 4 +++- sbin/pfctl/pfctl_parser.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 23d0129a372..3681d43faee 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl.c,v 1.292 2010/01/12 03:20:51 mcbride Exp $ */ +/* $OpenBSD: pfctl.c,v 1.293 2010/01/13 01:41:58 jsg Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1283,6 +1283,8 @@ pfctl_rules(int dev, char *filename, int opts, int optimize, goto _error; } + free(path); + if ((altqsupport && (pf.loadopt & PFCTL_FLAG_ALTQ) != 0)) if (check_commit_altq(dev, opts) != 0) ERRX("errors in altq config"); diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 8c902591479..af236f89562 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.259 2010/01/12 16:21:24 mcbride Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.260 2010/01/13 01:41:58 jsg Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1417,6 +1417,8 @@ host(const char *s) err(1, "host: strdup"); mask = strtol(p+1, &q, 0); if (!q || *q || mask > 128 || q == (p+1)) { + free(p); + free(r); fprintf(stderr, "invalid netmask '%s'\n", p); return (NULL); } -- cgit v1.2.3