From a63eece62bccebd1a96df8cd8f1876d1d9117f6d Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Fri, 30 Jan 2004 23:12:52 +0000 Subject: missing free() in an error path that should be unreachable From: Patrick Latifi --- usr.sbin/bgpd/pfkey.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.sbin/bgpd/pfkey.c') diff --git a/usr.sbin/bgpd/pfkey.c b/usr.sbin/bgpd/pfkey.c index 78841906cdc..86f4fdafec5 100644 --- a/usr.sbin/bgpd/pfkey.c +++ b/usr.sbin/bgpd/pfkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfkey.c,v 1.12 2004/01/28 23:31:28 henning Exp $ */ +/* $OpenBSD: pfkey.c,v 1.13 2004/01/30 23:12:51 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -242,8 +242,11 @@ pfkey_reply(int sd, u_int32_t *spip) } if (hdr.sadb_msg_type == SADB_GETSPI) { - if (spip == NULL) + if (spip == NULL) { + bzero(data, len); + free(data); return (0); + } msg = (struct sadb_msg *)data; for (ext = (struct sadb_ext *)(msg + 1); -- cgit v1.2.3