Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: vpnc: devel

vpnc-nortel memory leak

 

 

vpnc devel RSS feed   Index | Next | Previous | View Threaded


libin.charles at gmail

Oct 14, 2009, 2:36 AM

Post #1 of 3 (257 views)
Permalink
vpnc-nortel memory leak

Hi,

When call the asprintf , I failed to notice a matching call to free.
Please view the patch.


Sincerely Yours,

Bin Li

http://cn.opensuse.org
Attachments: vpnc-nortel-memory-leak.patch (0.45 KB)


borneo.antonio at gmail

Oct 16, 2009, 9:35 AM

Post #2 of 3 (215 views)
Permalink
Re: vpnc-nortel memory leak [In reply to]

Ciao Ben Li,

you are right, I introduced a memory leak.
Will commit your patch in svn asap.

Best Regards,
Antonio Borneo

On Wed, Oct 14, 2009 at 5:36 PM, Bin Li <libin.charles[at]gmail.com> wrote:
> Hi,
>
> When call the asprintf , I failed to notice a matching call to free.
> Please view the patch.
>
>
> Sincerely Yours,
>
> Bin Li
>
> http://cn.opensuse.org
_______________________________________________
vpnc-devel mailing list
vpnc-devel[at]unix-ag.uni-kl.de
https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel
http://www.unix-ag.uni-kl.de/~massar/vpnc/


borneo.antonio at gmail

Oct 25, 2009, 4:59 AM

Post #3 of 3 (168 views)
Permalink
Re: vpnc-nortel memory leak [In reply to]

Patch committed as 447.

I have removed the proposed check for NULL pointer, since this is not correct.
Man-page for asprintf reports:
int asprintf(char **strp, const char *fmt, ...);
...
RETURN VALUE
When successful, these functions return the number of bytes
printed, just like sprintf(3). If memory
allocation wasn’t possible, or some other error occurs, these
functions will return -1, and the con-
tents of strp is undefined.

vpnc uses asprintf in several points, and never checks return value.

Should we enforce the whole code agains allocation error?
Why not using a wrap around these memory functions, as "wget" code do
with xmalloc() (see file wget-1.12/lib/xmalloc.c) ?

Best Regards,
Antonio Borneo

On Sat, Oct 17, 2009 at 12:35 AM, Antonio Borneo
<borneo.antonio[at]gmail.com> wrote:
> Ciao Ben Li,
>
> you are right, I introduced a memory leak.
> Will commit your patch in svn asap.
>
> Best Regards,
> Antonio Borneo
>
> On Wed, Oct 14, 2009 at 5:36 PM, Bin Li <libin.charles[at]gmail.com> wrote:
>> Hi,
>>
>> When call the asprintf , I failed to notice a matching call to free.
>> Please view the patch.
>>
>>
>> Sincerely Yours,
>>
>> Bin Li
>>
>> http://cn.opensuse.org
>

_______________________________________________
vpnc-devel mailing list
vpnc-devel[at]unix-ag.uni-kl.de
https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel
http://www.unix-ag.uni-kl.de/~massar/vpnc/

vpnc devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.