From: Pavel Raiskup Date: Mon, 16 Jan 2017 11:45:03 +0000 (+0100) Subject: libltdl: handle ENOMEM in lt_dlloader_remove() X-Git-Tag: v2.4.7~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f003a1f96e67f3cb823c1c7081efab445e3f0c83;p=thirdparty%2Flibtool.git libltdl: handle ENOMEM in lt_dlloader_remove() Reported by Alexander Hass. * libltdl/lt_dlloader.c (lt_dlloader_remove): Detect NULL return value from lt_dlinterface_register. --- diff --git a/NO-THANKS b/NO-THANKS index 5aba7c89a..c59662c09 100644 --- a/NO-THANKS +++ b/NO-THANKS @@ -30,6 +30,7 @@ note to the bug-report mailing list (as seen at end of e.g., libtool --help). Akim Demaille akim@epita.fr !Albert Chin Albert Chin-A-Young china@thewrittenword.com +Alexander Hass alexander.hass@sap.com Andreas Schwab schwab@suse.de Brian Barrett brbarret@osl.iu.edu !Brian W. Barret diff --git a/libltdl/lt_dlloader.c b/libltdl/lt_dlloader.c index ba103c037..dbc645d24 100644 --- a/libltdl/lt_dlloader.c +++ b/libltdl/lt_dlloader.c @@ -168,6 +168,10 @@ lt_dlloader_remove (const char *name) /* Fail if there are any open modules that use this loader. */ iface = lt_dlinterface_register (id_string, NULL); + if (!iface) + /* No memory, error is already set. */ + return 0; + while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle;