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, ...);
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) ?
On Sat, Oct 17, 2009 at 12:35 AM, Antonio Borneo
<firstname.lastname@example.org> 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 <email@example.com> wrote:
>> When call the asprintf , I failed to notice a matching call to free.
>> Please view the patch.
>> Sincerely Yours,
>> Bin Li
vpnc-devel mailing list
firstname.lastname@example.org https://lists.unix-ag.uni-kl.de/mailman/listinfo/vpnc-devel http://www.unix-ag.uni-kl.de/~massar/vpnc/