lldpad/lldpad-0.9.43-lldpad-Avoid-possible-resource-leak-in-get_bcn.patch
2011-09-08 08:34:30 +02:00

34 lines
993 B
Diff

From d56a0ea97410f341f8892204ca6cfad02519e8bf Mon Sep 17 00:00:00 2001
From: Petr Sabata <contyk@redhat.com>
Date: Mon, 15 Aug 2011 18:13:40 -0700
Subject: [PATCH 22/29] lldpad: Avoid possible resource leak in get_bcn()
Signed-off-by: Petr Sabata <contyk@redhat.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
nltest.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/nltest.c b/nltest.c
index 2ae2212..e350ca9 100644
--- a/nltest.c
+++ b/nltest.c
@@ -781,12 +781,14 @@ static int get_bcn(char *ifname, bcn_cfg *bcn_data)
if (d->cmd != DCB_CMD_BCN_GCFG) {
printf("Hmm, this is not the message we were expecting.\n");
+ free(nlh);
return -EIO;
}
if (rta_parent->rta_type != DCB_ATTR_BCN) {
/* Do we really want to code up an attribute parser?? */
printf("A full libnetlink (with rtnl and attribute support) "
"would sure be nice.\n");
+ free(nlh);
return -EIO;
}
rta_child = NLA_DATA(rta_parent);
--
1.7.6