]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Fix memory leak of lname variable in get_target_name()
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 3 Oct 2011 05:23:30 +0000 (05:23 +0000)
committerStephen Hemminger <shemminger@vyatta.com>
Fri, 7 Oct 2011 18:17:10 +0000 (11:17 -0700)
Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
tc/m_ipt.c

index 99d9965a6744b57626be13edd0931d73430f2cf0..a73d400a0bb98d4b2d53d371ba4ca8c889254005 100644 (file)
@@ -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;
 }