summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-02-26 11:24:27 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-02-26 11:24:27 +0000
commit96bd43d21d340a98c5ae79ba36f6a369d5e9b63c (patch)
tree66cd7221587ff372b866a5f3ac6e809372c46ff5
parentffaaad5141d470af3ee6ce63493c04ab7e72f44e (diff)
fix small memleaks
-rw-r--r--usr.sbin/hoststated/relay.c5
-rw-r--r--usr.sbin/relayd/relay.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/hoststated/relay.c b/usr.sbin/hoststated/relay.c
index fc7a8b10a47..94fe7cc317f 100644
--- a/usr.sbin/hoststated/relay.c
+++ b/usr.sbin/hoststated/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.5 2007/02/25 18:16:16 deraadt Exp $ */
+/* $OpenBSD: relay.c,v 1.6 2007/02/26 11:24:26 reyk Exp $ */
/*
* Copyright (c) 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -946,6 +946,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
if (errstr) {
relay_close(con, errstr);
+ free(line);
return;
}
}
@@ -1408,6 +1409,8 @@ relay_close(struct session *con, const char *msg)
"%s%s%s", rlay->name, con->id, relay_sessions,
ibuf, obuf, ntohs(con->out.port), msg,
ptr == NULL ? "" : ",", ptr == NULL ? "" : ptr);
+ if (ptr != NULL)
+ free(ptr);
}
if (con->in.bev != NULL)
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index fc7a8b10a47..94fe7cc317f 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.5 2007/02/25 18:16:16 deraadt Exp $ */
+/* $OpenBSD: relay.c,v 1.6 2007/02/26 11:24:26 reyk Exp $ */
/*
* Copyright (c) 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -946,6 +946,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
if (errstr) {
relay_close(con, errstr);
+ free(line);
return;
}
}
@@ -1408,6 +1409,8 @@ relay_close(struct session *con, const char *msg)
"%s%s%s", rlay->name, con->id, relay_sessions,
ibuf, obuf, ntohs(con->out.port), msg,
ptr == NULL ? "" : ",", ptr == NULL ? "" : ptr);
+ if (ptr != NULL)
+ free(ptr);
}
if (con->in.bev != NULL)