Fix a reference counting problem when using dlopen(NULL, ...).

PR:		bin/12129
This commit is contained in:
jdp 1999-06-25 04:50:06 +00:00
parent 2be78ea16b
commit 3ff496fa33

View File

@ -22,7 +22,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: rtld.c,v 1.23 1999/04/22 01:54:38 jdp Exp $
* $Id: rtld.c,v 1.24 1999/06/25 02:53:48 jdp Exp $
*/
/*
@ -1159,9 +1159,10 @@ dlopen(const char *name, int mode)
GDB_STATE(RT_ADD);
if (name == NULL)
if (name == NULL) {
obj = obj_main;
else {
obj->refcount++;
} else {
char *path = find_library(name, obj_main);
if (path != NULL)
obj = load_object(path);