changeset 35516:f0d335e847c5

8145698: Memory leak in add_lib_info_fd of libproc_impl.c:174 Summary: Added missed free call Reviewed-by: jbachorik, sspitsyn
author dsamersoff
date Sat, 16 Jan 2016 13:56:49 +0300
parents 663c609dfeee
children 7d5ff5ee627c
files hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);