]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (lt_dlcaller_get_data): Work even when no caller
authorEric Blake <ebb9@byu.net>
Wed, 5 Sep 2007 19:23:37 +0000 (19:23 +0000)
committerEric Blake <ebb9@byu.net>
Wed, 5 Sep 2007 19:23:37 +0000 (19:23 +0000)
has set data.

ChangeLog
libltdl/ltdl.c

index 850636905ed6ac821e0fa4052f83fda8b83bd2db..293dbf3399edb2821beb74e01704696a024a7ef0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-05  Eric Blake  <ebb9@byu.net>
+
+       * libltdl/ltdl.c (lt_dlcaller_get_data): Work even when no caller
+       has set data.
+
 2007-09-01  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * NEWS: Update.
index a83a02c6d460ed5270312eb487802a99ccb17a54..7519a4fdcd13663231372ddaf64f5ed6076d7506 100644 (file)
@@ -4307,17 +4307,18 @@ lt_dlcaller_get_data  (key, handle)
   LT_DLMUTEX_LOCK ();
 
   /* Locate the index of the element with a matching KEY.  */
-  {
-    int i;
-    for (i = 0; handle->caller_data[i].key; ++i)
-      {
-       if (handle->caller_data[i].key == key)
-         {
-           result = handle->caller_data[i].data;
-           break;
-         }
-      }
-  }
+  if (handle->caller_data)
+    {
+      int i;
+      for (i = 0; handle->caller_data[i].key; ++i)
+        {
+          if (handle->caller_data[i].key == key)
+            {
+              result = handle->caller_data[i].data;
+              break;
+            }
+        }
+    }
 
   LT_DLMUTEX_UNLOCK ();