8145698: Memory leak in add_lib_info_fd of libproc_impl.c:174
Summary: Added missed free call
Reviewed-by: jbachorik, sspitsyn
--- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c Thu Jan 14 09:18:11 2016 +0100
+++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c Sat Jan 16 13:56:49 2016 +0300
@@ -171,6 +171,7 @@
if (strlen(libname) >= sizeof(newlib->name)) {
print_debug("libname %s too long\n", libname);
+ free(newlib);
return NULL;
}
strcpy(newlib->name, libname);
--- a/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c Thu Jan 14 09:18:11 2016 +0100
+++ b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c Sat Jan 16 13:56:49 2016 +0300
@@ -217,6 +217,7 @@
if (strlen(libname) >= sizeof(newlib->name)) {
print_debug("libname %s too long\n", libname);
+ free(newlib);
return NULL;
}
strcpy(newlib->name, libname);