diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-11-29 12:10:52 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-11-29 12:10:52 +0000 |
commit | c819ba76542b74590d10eb1c619f8abbcca766e7 (patch) | |
tree | 90f7d8011e877359250d61a01e09cc34af6adc43 /usr.sbin | |
parent | 3366c38638c164e5185e4c29a0cb52070f5e0de9 (diff) |
community_ext_delete_non_trans() allocates new memory in all cases where
nlen > 0. So in those cases it is important to free() that memory after
use in all cases.
OK phessler@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde_update.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c index 8157342058e..a9de19cc663 100644 --- a/usr.sbin/bgpd/rde_update.c +++ b/usr.sbin/bgpd/rde_update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_update.c,v 1.104 2018/11/28 08:32:27 claudio Exp $ */ +/* $OpenBSD: rde_update.c,v 1.105 2018/11/29 12:10:51 claudio Exp $ */ /* * Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org> @@ -765,7 +765,7 @@ up_generate_attr(struct rde_peer *peer, struct update_attr *upa, u_int16_t len = sizeof(up_attr_buf), wlen = 0, plen; u_int8_t l; u_int16_t nlen = 0; - u_char *ndata = NULL; + u_char *ndata; /* origin */ if ((r = attr_write(up_attr_buf + wlen, len, ATTR_WELL_KNOWN, @@ -902,6 +902,7 @@ up_generate_attr(struct rde_peer *peer, struct update_attr *upa, free(ndata); return (-1); } + free(ndata); } else { /* everything got removed */ r = 0; |