34 lines
875 B
Diff
34 lines
875 B
Diff
From e81f41287bbdb61da21b51e1e75423ad188003ca Mon Sep 17 00:00:00 2001
|
|
From: Petr Sabata <contyk@redhat.com>
|
|
Date: Mon, 15 Aug 2011 18:13:42 -0700
|
|
Subject: [PATCH 23/29] Avoid possible resource leaks
|
|
|
|
This patch prevents possible resource leaks in mand_clif_cmd().
|
|
|
|
Signed-off-by: Petr Sabata <contyk@redhat.com>
|
|
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
|
|
---
|
|
lldp_mand_cmds.c | 5 ++++-
|
|
1 files changed, 4 insertions(+), 1 deletions(-)
|
|
|
|
diff --git a/lldp_mand_cmds.c b/lldp_mand_cmds.c
|
|
index d09d6a5..264d836 100644
|
|
--- a/lldp_mand_cmds.c
|
|
+++ b/lldp_mand_cmds.c
|
|
@@ -492,8 +492,11 @@ int mand_clif_cmd(void *data,
|
|
|
|
/* Confirm port is a lldpad managed port */
|
|
port = port_find_by_name(cmd.ifname);
|
|
- if (!port)
|
|
+ if (!port) {
|
|
+ free(argvals);
|
|
+ free(args);
|
|
return cmd_device_not_found;
|
|
+ }
|
|
|
|
switch (cmd.cmd) {
|
|
case cmd_getstats:
|
|
--
|
|
1.7.6
|
|
|