diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-04-15 03:12:31 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2012-04-15 03:12:31 +0000 |
commit | 2f5144ae1b5cfcc64066cf2025de155577e045df (patch) | |
tree | ed0e16c4fea7cbc0ef8642d8ea82b40aea622025 /usr.sbin/relayd | |
parent | 835f7dcd20043dfc07053ae2a228e62135fc109f (diff) |
fix some leaks
ok krw@
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r-- | usr.sbin/relayd/parse.y | 3 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y index a6427c58b3f..a45c43692e2 100644 --- a/usr.sbin/relayd/parse.y +++ b/usr.sbin/relayd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.161 2012/01/21 13:40:48 camield Exp $ */ +/* $OpenBSD: parse.y,v 1.162 2012/04/15 03:12:30 jsg Exp $ */ /* * Copyright (c) 2007-2011 Reyk Floeter <reyk@openbsd.org> @@ -2691,6 +2691,7 @@ table_inherit(struct table *tb) h->conf.id = ++last_host_id; if (last_host_id == INT_MAX) { yyerror("too many hosts defined"); + free(h); goto fail; } h->conf.tableid = tb->conf.id; diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c index 141692c22e0..dd3410916ad 100644 --- a/usr.sbin/relayd/relayd.c +++ b/usr.sbin/relayd/relayd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.c,v 1.106 2012/01/21 13:40:48 camield Exp $ */ +/* $OpenBSD: relayd.c,v 1.107 2012/04/15 03:12:30 jsg Exp $ */ /* * Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org> @@ -813,6 +813,7 @@ expand_string(char *label, size_t len, const char *srch, const char *repl) if ((strlcat(tmp, p, len) >= len) || (strlcat(tmp, repl, len) >= len)) { log_debug("%s: string too long", __func__); + free(tmp); return (-1); } q += strlen(srch); @@ -820,6 +821,7 @@ expand_string(char *label, size_t len, const char *srch, const char *repl) } if (strlcat(tmp, p, len) >= len) { log_debug("%s: string too long", __func__); + free(tmp); return (-1); } (void)strlcpy(label, tmp, len); /* always fits */ |