JDK-6689153 : Memory leak in WriteTimeStamp() of RegCommon.cpp
  • Type: Bug
  • Component: install
  • Sub-Component: install
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-04-16
  • Updated: 2010-09-17
  • Resolved: 2008-06-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u10 b23Fixed 7Fixed
Description
The Insure++ tool detects a memory leak in the WriteTimeStamp() method of RegCommon.cpp during running of an applet. The reported leak is a char array whose memory should be released prior to exiting the function.

The following report is generated by Insure++:

  Runtime: Executing "IEXPLORE", pid=544
>> }
  Memory leaked leaving scope: currentTimeStr
  Lost block : 0x0e5b4cf8 thru 0x0e5b4dfb (260 bytes)
               currentTimeStr, allocated at RegCommon.cpp, 132
                      _nh_malloc()  (interface)
                    operator new()
                  WriteTimeStamp()  ..\..\..\src\plugin\win32\regutils\RegCommon.cpp, 132
Java_com_sun_deploy_panel_PlatformSpecificUtils_getJqsSettings()  ..\..\..\src\plugin\win32\regutils\RegJControl.cpp, 811
         regutils.dll 0x04b19d11()
                    ** routines compiled without debug info **
              JNIEnv_::FindClass()  jni.h, 776
      CAxControl::FinalConstruct()  ..\..\..\..\src\plugin\win32\plugin2\jp2iexp\AxControl.cpp, 92
ATL::CComCreator<ATL::CComObject<CAxControl> >::CreateInstance()  atlcom.h, 1766
ATL::CComCreator2<ATL::CComCreator<ATL::CComObject<CAxControl> >,ATL::CComCreator<ATL::CComAggObject<CAxControl> > >::CreateInstance()  atlcom.h, 1834
ATL::CComClassFactory::CreateInstance()  atlcom.h, 3182
           mshtml.dll 0x438ad18f()
                    ** routines compiled without debug info **
                DispatchMessageW()  (interface)
          IEFRAME.dll 0x42f8e693()
  Stack trace where the error occurred:
                  WriteTimeStamp()  ..\..\..\src\plugin\win32\regutils\RegCommon.cpp, 153
Java_com_sun_deploy_panel_PlatformSpecificUtils_getJqsSettings()  ..\..\..\src\plugin\win32\regutils\RegJControl.cpp, 811
         regutils.dll 0x04b19d11()
                    ** routines compiled without debug info **
              JNIEnv_::FindClass()  jni.h, 776
      CAxControl::FinalConstruct()  ..\..\..\..\src\plugin\win32\plugin2\jp2iexp\AxControl.cpp, 92
ATL::CComCreator<ATL::CComObject<CAxControl> >::CreateInstance()  atlcom.h, 1766
ATL::CComCreator2<ATL::CComCreator<ATL::CComObject<CAxControl> >,ATL::CComCreator<ATL::CComAggObject<CAxControl> > >::CreateInstance()  atlcom.h, 1834
ATL::CComClassFactory::CreateInstance()  atlcom.h, 3182
           mshtml.dll 0x438ad18f()
                    ** routines compiled without debug info **
                DispatchMessageW()  (interface)
          IEFRAME.dll 0x42f8e693()

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6689153.0
16-04-2008

EVALUATION A simple fix is to delete the char array before returning from WriteTimeStamp().
16-04-2008