From f003a1f96e67f3cb823c1c7081efab445e3f0c83 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 16 Jan 2017 12:45:03 +0100 Subject: [PATCH] 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. --- NO-THANKS | 1 + libltdl/lt_dlloader.c | 4 ++++ 2 files changed, 5 insertions(+) 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; -- 2.47.3