bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] look this and think, is this a bug!


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] look this and think, is this a bug!
Date: Thu, 12 Apr 2007 19:33:47 +0300

<address@hidden> wrote:

>     I read some code of mailbox,  there is a function name
>     mu_mailbox_create_default  as follows,  i add a comment and a few
>     codes,  then resolve a memory leak

There are two possible memory leaks in this function.  They are fixed in
the repository.  Thanks for reporting. 

>  /* I add comment and a few codes */
>  /* if ((mail != NULL) && (tmp_mbox == NULL)), then char *p not free, then 
> add this */
>   if (p)
>     free (p);

This change thrashes the memory area and coredumps right away (in the
best case), or induces a coredump in some remote point (in the worst
case).  Both `p' and `tmp_mbox' can point to the same memory location,
which will be freed twice. 

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]