f67e91
From 3f91af8052486127ce787a91d47fadc033948877 Mon Sep 17 00:00:00 2001
f67e91
From: Pavel Raiskup <praiskup@redhat.com>
f67e91
Date: Mon, 16 Jan 2017 14:58:59 +0100
f67e91
Subject: [PATCH] libltdl: handle ENOMEM in lt_dlloader_remove()
f67e91
f67e91
Reported by Alexander Hass.
f67e91
f67e91
* libltdl/lt_dlloader.c (lt_dlloader_remove): Detect NULL return
f67e91
value from lt_dlinterface_register.
f67e91
---
f67e91
 libltdl/lt_dlloader.c | 4 ++++
f67e91
 1 file changed, 4 insertions(+)
f67e91
f67e91
diff --git a/libltdl/lt_dlloader.c b/libltdl/lt_dlloader.c
f67e91
index 2c99a22..ed45195 100644
f67e91
--- a/libltdl/lt_dlloader.c
f67e91
+++ b/libltdl/lt_dlloader.c
f67e91
@@ -167,6 +167,10 @@ lt_dlloader_remove (const char *name)
f67e91
 
f67e91
   /* Fail if there are any open modules which use this loader.  */
f67e91
   iface = lt_dlinterface_register (id_string, NULL);
f67e91
+  if (!iface)
f67e91
+    /* No memory, error is already set. */
f67e91
+    return 0;
f67e91
+
f67e91
   while ((handle = lt_dlhandle_iterate (iface, handle)))
f67e91
     {
f67e91
       lt_dlhandle cur = handle;
f67e91
-- 
f67e91
2.9.3
f67e91