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

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

 



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.

    I appreciate your work in the man pages, they were improved a lot
since you've started working on them. Also, I appreciate your concerns
regarding paccept().

    Notice that I sent two different patches in a sequence (sorry for that).

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 ;-)

Kind regards,
-- 
[]s,
André Goddard
--
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