summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/relayd/parse.y3
-rw-r--r--usr.sbin/relayd/relayd.c4
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 */