Hello Eric,

* Eric Blake wrote on Tue, Oct 03, 2006 at 01:55:20PM CEST:
> 
> I noticed this while debugging a memory leak in m4.  This is against head,
> but if it is approved, I imagine it needs to be backported to the branch
> as well.  OK to apply?

The first hunk looks good, I'm not so sure about the second.
Which system do you see this on, and how do you track memleaks down
there?

Cheers, and thanks,
Ralf

> 2006-10-02  Eric Blake  <[EMAIL PROTECTED]>
> 
>       * libltdl/ltdl.c (load_deplibs): Avoid memleak on failure.
>       (unload_deplibs): Avoid memleak on unload.

> Index: libltdl/ltdl.c
> ===================================================================
> RCS file: /sources/libtool/libtool/libltdl/ltdl.c,v
> retrieving revision 1.244
> diff -u -p -r1.244 ltdl.c
> --- libltdl/ltdl.c    4 Sep 2006 17:43:37 -0000       1.244
> +++ libltdl/ltdl.c    3 Oct 2006 11:52:25 -0000
> @@ -855,7 +855,7 @@ load_deplibs (lt_dlhandle handle, char *
>  
>        cur->deplibs = (lt_dlhandle *) MALLOC (lt__handle, depcount);
>        if (!cur->deplibs)
> -     goto cleanup;
> +     goto cleanup_names;
>  
>        for (i = 0; i < depcount; ++i)
>       {
> @@ -903,6 +903,7 @@ unload_deplibs (lt_dlhandle handle)
>             errors += lt_dlclose (cur->deplibs[i]);
>           }
>       }
> +      FREE (cur->deplibs);
>      }
>  
>    return errors;


Reply via email to