bug-cvs
[Top][All Lists]
Advanced

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

Re: memory leak & patch


From: Kenneth Lorber
Subject: Re: memory leak & patch
Date: Wed, 11 Jun 2003 12:53:00 -0400 (EDT)

        From address@hidden Wed Jun 11 12:42:56 2003
        Subject: Re: memory leak & patch
        To: address@hidden (Kenneth Lorber)
        Date: Wed, 11 Jun 2003 12:41:21 -0400 (EDT)
        Cc: address@hidden
        In-Reply-To: <address@hidden> from "Kenneth Lorber" at Jun 11, 2003 
12:22:17 PM
        From: address@hidden (Larry Jones)
        X-Mailer: ELM [version 2.5 PL3]

        Kenneth Lorber writes:
        > 
        > This fixes a leak in xresolvepath.

        No it doesn't.  Calling error() with an initial argument of 1 makes it
        call exit(), which terminates the process and frees *all* the memory, so
        there's no leak.
I almost put a note about that in the email, but I decided not to - my
mistake.

I think the addition of the final free() fixes a real leak.  (owd comes from
xgetwd(), and xgetwd()'s return value needs to be free()'d.)

The free()'s before the calls to error() bring up a style issue.  If I'm
debugging a program, I want it to release all memory before it exit()'s so
I can see what's leaked, even if I'm exiting on an error.  If cvs
doesn't get coded that way, my apologies for not noticing and cleaning up
too much :-)

keni




reply via email to

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