netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [iproute2 PATCH 05/11] Fix memory leak of lname variable in get_target_name()
@ 2011-10-03 15:23 Thomas Jarosch
  0 siblings, 0 replies; only message in thread
From: Thomas Jarosch @ 2011-10-03 15:23 UTC (permalink / raw)
  To: netdev

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
---
 tc/m_ipt.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tc/m_ipt.c b/tc/m_ipt.c
index 99d9965..a73d400 100644
--- a/tc/m_ipt.c
+++ b/tc/m_ipt.c
@@ -281,6 +281,7 @@ get_target_name(const char *name)
 			fputs(dlerror(), stderr);
 			printf("\n");
 			free(new_name);
+			free(lname);
 			return NULL;
 		}
 	}
@@ -297,6 +298,7 @@ get_target_name(const char *name)
 					fprintf(stderr, "\n");
 					dlclose(handle);
 					free(new_name);
+					free(lname);
 					return NULL;
 				}
 			}
@@ -304,6 +306,7 @@ get_target_name(const char *name)
 	}
 
 	free(new_name);
+	free(lname);
 	return m;
 }
 
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-03 15:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03 15:23 [iproute2 PATCH 05/11] Fix memory leak of lname variable in get_target_name() Thomas Jarosch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).