Fix memory leak of lname variable in get_target_name()

Detected by cppcheck.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
This commit is contained in:
Thomas Jarosch 2011-10-03 05:23:30 +00:00 committed by Stephen Hemminger
parent 9f1ba57016
commit 1a6543c56b
1 changed files with 3 additions and 0 deletions

View 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;
}