diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-30 22:42:32 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-30 22:42:32 +0000 |
commit | a4bbcf776eebc0a8cfa75aa2e1e776210498a8cb (patch) | |
tree | abdca2fe368266c9bf0b2fae6a938ef1726281b9 /usr.sbin/bgpd/imsg.c | |
parent | 7b55293f7b5f3a79d926ed0c053b33eef0abcfdd (diff) |
correctly free after buf_add/_close errs.
From: Patrick Latifi <pat@eyeo.org>
Diffstat (limited to 'usr.sbin/bgpd/imsg.c')
-rw-r--r-- | usr.sbin/bgpd/imsg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/imsg.c b/usr.sbin/bgpd/imsg.c index 2214fb7e2d1..ed80e399c45 100644 --- a/usr.sbin/bgpd/imsg.c +++ b/usr.sbin/bgpd/imsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.13 2003/12/30 20:59:43 henning Exp $ */ +/* $OpenBSD: imsg.c,v 1.14 2003/12/30 22:42:31 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -101,19 +101,19 @@ imsg_compose(struct imsgbuf *ibuf, int type, u_int32_t peerid, void *data, } if (buf_add(wbuf, &hdr, sizeof(hdr)) == -1) { logit(LOG_CRIT, "imsg_compose: buf_add error"); - free(wbuf); + buf_free(wbuf); return (-1); } if (datalen) if (buf_add(wbuf, data, datalen) == -1) { logit(LOG_CRIT, "imsg_compose: buf_add error"); - free(wbuf); + buf_free(wbuf); return (-1); } if ((n = buf_close(&ibuf->w, wbuf)) < 0) { logit(LOG_CRIT, "imsg_compose: buf_add error"); - free(wbuf); + buf_free(wbuf); return (-1); } return (n); |