[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/nsplugins/viewer
From:       George Staikos <staikos () kde ! org>
Date:       2003-02-28 18:12:00
[Download RAW message or body]

CVS commit by staikos: 

Initialise memory!

Also fix my previous memleak fix to check for null before calling free().


And one for the record books:

==31591== 144000 bytes in 12 blocks are definitely lost in loss record 198 of 20
0
==31591==    at 0x401676C8: malloc (vg_clientfuncs.c:100)
==31591==    by 0x46BD5128: (within /opt/netscape/plugins/old/libflashplayer.so)
==31591==
==31591== 24912000 bytes in 108 blocks are possibly lost in loss record 200 of 2
00
==31591==    at 0x401676C8: malloc (vg_clientfuncs.c:100)
==31591==    by 0x46BD5128: (within /opt/netscape/plugins/old/libflashplayer.so)

If I let it run longer, it just keeps expanding.


  M +5 -2      nsplugin.cpp   1.87


--- kdebase/nsplugins/viewer/nsplugin.cpp  #1.86:1.87
@@ -1104,4 +1104,5 @@ DCOPRef NSPluginClass::newInstance( QStr
                                            // since the nsplugin plays with
                                            // this thing
+   memset(npp, 0, sizeof(NPP_t));
    npp->ndata = NULL;
 
@@ -1159,4 +1160,5 @@ NSPluginStreamBase::~NSPluginStreamBase(
    if (_stream) {
       _instance->NPDestroyStream( _stream, NPRES_USER_BREAK );
+      if (_stream && _stream->url)
       free(const_cast<char*>(_stream->url));
       delete _stream;
@@ -1371,4 +1373,5 @@ void NSPluginStreamBase::finish( bool er
 
     // delete stream
+    if (_stream && _stream->url)
     free(const_cast<char *>(_stream->url));
     delete _stream;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic