Re: [patch] tsearch.3: dispose properly of allocated resources in example code

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

 



André,

On Tue, Sep 23, 2008 at 3:23 PM, André Goddard Rosa
<andre.goddard@xxxxxxxxx> wrote:
> On Tue, Sep 23, 2008 at 3:28 AM, Michael Kerrisk
> <mtk.manpages@xxxxxxxxxxxxxx> wrote:
>> André,
>>
>> On Sun, Sep 21, 2008 at 8:10 AM, André Goddard Rosa
>> <andre.goddard@xxxxxxxxx> wrote:
>>> As there are many users who base their own code on these examples, we
>>> should avoid leaking memory when using functions of tsearch() family.
>>> In the provided example, tsearch() leaks memory whenever it tries to
>>> insert a number which was already inserted before.
>>
>> Thanks.  My first patch applied via 'git am'!
>>
>> I applied this patch for man-pages-3.10.  (I added
>> #define _GNU_SOURCE
>> since that's required to expose the tdestroy() declaration.)
>>
>
> Hi, Michael!
>
>    Very nice, thank you! Good to know that you're using git.

(At last... '-).)

>    I appreciate your work in the man pages, they were improved a lot
> since you've started working on them.

Thanks!

> Also, I appreciate your concerns
> regarding paccept().
>
>    Notice that I sent two different patches in a sequence (sorry for that).

It's a good thing you mentioned this, since I did _not_ notice that:
you sent two mails at almost the same, with the same description, and
which looked otherwise identical (unless one looked very close), so I
assumed you had accidentally sent the same mail twice.  (Best to
change the description a little so I know you are resending a
different patch.)

> This is the first one:
>
>> +        else if (!((*(int **) val) == ptr))
>
> and this is the second one:
>
> +        else if ((*(int **) val) != ptr)
>
>    They work the same, but second is cleaner and simpler ;-)

Okay -- I've fixed the page to use the second version.  And you only
just got that one in in time for 3.10!

Thanks,

Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux