From: Eric Blake Date: Wed, 5 Sep 2007 19:23:37 +0000 (+0000) Subject: * libltdl/ltdl.c (lt_dlcaller_get_data): Work even when no caller X-Git-Tag: release-1-5-26~24 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=44f7a88fd6ee58d9d167090423eab42b0c2fe91c;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (lt_dlcaller_get_data): Work even when no caller has set data. --- diff --git a/ChangeLog b/ChangeLog index 850636905..293dbf339 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-05 Eric Blake + + * libltdl/ltdl.c (lt_dlcaller_get_data): Work even when no caller + has set data. + 2007-09-01 Ralf Wildenhues * NEWS: Update. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index a83a02c6d..7519a4fdc 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -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 ();