[Pkg-octave-devel] Bug#541433: Bug#541433: octave-sockets: memory leak

paul slask at paulsundvall.net
Sun Aug 16 22:10:25 UTC 2009


Hi Thomas,
I posted a message [1] on the octave-dev mailing list but this far I
have not received comments on the suggested patch. I also applied for
being a maintainer, I could then fix the problem myself. In the
meanwhile, I would be happy if debians package would be correct as I
find it a lot easier using standard installations rather than applying
the package by hand on every client I use. I do not know if a memory
leak is serious enough to warrant a debian specific change.

That ">> +"\n pauls version")" was a mistake, I just used it to make
sure the change made it through. It should be removed from the patch.

Paul

[1]
http://www.nabble.com/patch-to-resolve-memory-leak-in-package-socket-to24969364.html

Thomas Weber skrev:
> On Fri, Aug 14, 2009 at 08:22:37AM +0200, Paul Sundvall wrote:
>> Package: octave-sockets
>> Version: 1.0.4-3
>> Severity: important
>>
>> There are two memory leaks in sockets.cc 
>> The first one is a new[] which is paired with delete and not delete[].
>> The second one has a new[] but no delete[].
>>
>> I suggest a patch which is attached.
> 
> I will forward your patch upstream, but one question, see below:
> 
> 
>> --- sockets.cc.debian-1.0.4-3	2009-08-14 08:11:38.000000000 +0200
>> +++ sockets.cc	2009-08-14 08:14:23.000000000 +0200
>> @@ -528,7 +528,7 @@ DEFUN_DLD(send,args,nargout, \
>>      for ( int i = 0 ; i < d1.length() ; i++ )
>>        buf[i] = (unsigned char)d1(i);
>>      retval = ::send( s->get_sock_fd(), (const char*)buf, data.byte_size(), 0 );
>> -    delete buf;
>> +    delete[] buf;
>>    }
>>    else
>>    {
>> @@ -543,7 +543,8 @@ DEFUN_DLD(send,args,nargout, \
>>  // function to receive data over a socket
>>  DEFUN_DLD(recv,args,nargout, \
>>  	  "recv(octave_socket,int)\nSee the send() man pages.  This will only allow the" \
>> -	  " user to receive uint8 arrays or strings")
>> +	  " user to receive uint8 arrays or strings" \
>> +"\n pauls version")
> 
> Do you really want this "pauls version" to be part of the diff?
> 
> 	Thomas





More information about the Pkg-octave-devel mailing list