Index: sid/component/cfgroot/libltdl/ltdl.c =================================================================== RCS file: /cvs/src/src/sid/component/cfgroot/libltdl/ltdl.c,v retrieving revision 1.4 diff -c -p -r1.4 ltdl.c *** sid/component/cfgroot/libltdl/ltdl.c 17 Jan 2007 21:17:08 -0000 1.4 --- sid/component/cfgroot/libltdl/ltdl.c 24 Jan 2007 21:34:46 -0000 *************** lt_dlexit () *** 2329,2344 **** { ++errors; } } - /* Make sure that the handle pointed to by 'cur' still exists. - lt_dlclose recursively closes dependent libraries which removes - them from the linked list. One of these might be the one - pointed to by 'cur'. */ - for (tmp = handles; tmp; tmp = tmp->next) - if (tmp == cur) - break; - if (! tmp) - cur = handles; } /* done if only resident modules are left */ if (!saw_nonresident) --- 2329,2347 ---- { ++errors; } + /* Make sure that the handle pointed to by 'cur' still exists. + lt_dlclose recursively closes dependent libraries which removes + them from the linked list. One of these might be the one + pointed to by 'cur'. */ + if (cur) + { + for (tmp = handles; tmp; tmp = tmp->next) + if (tmp == cur) + break; + if (! tmp) + cur = handles; + } } } /* done if only resident modules are left */ if (!saw_nonresident)