summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2008-10-09 14:14:41 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2008-10-09 14:14:41 +0000
commit4a28c84a91ac850d319f31b2f3e46643aca3a368 (patch)
treed00f3f82fcb25c18ed0e143b99364fc0958b3027
parent8dfbcc107ae8fa03ae248651853ef29d251a3e86 (diff)
plug memleak by calling ber_free() after sending a trap to cleanup the
BER write buffer.
-rw-r--r--usr.sbin/snmpd/trap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/trap.c b/usr.sbin/snmpd/trap.c
index e411ac27104..bcd02506772 100644
--- a/usr.sbin/snmpd/trap.c
+++ b/usr.sbin/snmpd/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.12 2008/03/18 16:57:58 reyk Exp $ */
+/* $OpenBSD: trap.c,v 1.13 2008/10/09 14:14:40 reyk Exp $ */
/*
* Copyright (c) 2008 Reyk Floeter <reyk@vantronix.net>
@@ -284,6 +284,7 @@ trap_send(struct ber_oid *oid, struct ber_element *elm)
if (elm != NULL)
ber_unlink_elements(c);
ber_free_elements(trap);
+ ber_free(&ber);
return (ret);
}