bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19890: [PATCH] Check for strdup NULL return value


From: Tobias Stoeckmann
Subject: bug#19890: [PATCH] Check for strdup NULL return value
Date: Tue, 17 Feb 2015 22:59:55 +0100

In contrast to previous mail, only check for strdup NULL value.
The FREE macro properly sets module to NULL, therefore this one is
the only issue left.
---
Sorry for the previous noise.
---
 libltdl/loaders/dld_link.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libltdl/loaders/dld_link.c b/libltdl/loaders/dld_link.c
index a73880f..54053ee 100644
--- a/libltdl/loaders/dld_link.c
+++ b/libltdl/loaders/dld_link.c
@@ -112,7 +112,11 @@ vm_open (lt_user_data loader_data LT__UNUSED, const char 
*filename,
 {
   lt_module module = lt__strdup (filename);
 
-  if (dld_link (filename) != 0)
+  if (module == NULL)
+    {
+      LT__SETERROR (NO_MEMORY);
+    }
+  else if (dld_link (filename) != 0)
     {
       LT__SETERROR (CANNOT_OPEN);
       FREE (module);
-- 
2.3.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]