From: Eric Blake Date: Sun, 13 Nov 2005 21:59:54 +0000 (+0000) Subject: * libltdl/ltdl.c (lt_dlhandle_iterate): Fix endless loop. X-Git-Tag: release-2-1b~400 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67e7c9e8e1b6ed005b7b307bb40bf3ca41b67ae0;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (lt_dlhandle_iterate): Fix endless loop. (lt_dlinterface_register): Fail if lt__strdup did. --- diff --git a/ChangeLog b/ChangeLog index 85475683c..339be7da4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-13 Eric Blake + + * libltdl/ltdl.c (lt_dlhandle_iterate): Fix endless loop. + (lt_dlinterface_register): Fail if lt__strdup did. + 2005-11-13 Ralf Wildenhues * libltdl/m4/libtool.m4 (_LT_LANG_C_CONFIG): diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 38b6bdc2d..77a7ffeb0 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -2027,7 +2027,10 @@ lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) if (interface_id) { interface_id->id_string = lt__strdup (id_string); - interface_id->iface = iface; + if (!interface_id->id_string) + FREE (interface_id); + else + interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; @@ -2125,6 +2128,8 @@ lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place) if (!handle) handle = (lt__handle *) handles; + else + handle = handle->next; /* advance while the interface check fails */ while (handle && iterator->iface