From: Eric Blake Date: Fri, 13 Oct 2006 14:11:18 +0000 (+0000) Subject: * libltdl/ltdl.c (load_deplibs): Avoid memory leak on failure. X-Git-Tag: release-2-1b~239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65e173f8cb9e5b848638324359ae5d12f5256db9;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (load_deplibs): Avoid memory leak on failure. (unload_deplibs): Avoid memory leak on cleanup. --- diff --git a/ChangeLog b/ChangeLog index 3f277d02a..beaab42c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-13 Eric Blake + + * libltdl/ltdl.c (load_deplibs): Avoid memory leak on failure. + (unload_deplibs): Avoid memory leak on cleanup. + 2006-09-20 Ralf Wildenhues * libltdl/m4/libtool.m4 (func_mode_compile): Accept files with diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index b43d3d0f5..1cf608573 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -855,7 +855,7 @@ load_deplibs (lt_dlhandle handle, char *deplibs) 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;