From 588c673fc4a6f22a8bb92712ca3c08e732f2bc22 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 24 Feb 2005 16:05:22 +0000 Subject: [PATCH] Also bumb the reference counters when a object is already loaded. --- libexec/rtld-elf/rtld.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 70adf6f2bb..9553a687df 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/libexec/rtld-elf/rtld.c,v 1.43.2.15 2003/02/20 20:42:46 kan Exp $ - * $DragonFly: src/libexec/rtld-elf/rtld.c,v 1.15 2005/02/24 15:46:24 joerg Exp $ + * $DragonFly: src/libexec/rtld-elf/rtld.c,v 1.16 2005/02/24 16:05:22 joerg Exp $ */ /* @@ -1261,14 +1261,19 @@ load_object(char *path) obj = find_object(path); if (obj != NULL) { + obj->refcount++; free(path); return(obj); } obj = find_object2(path, &fd, &sb); - if (obj != NULL || fd == -1) { + if (obj != NULL) { + obj->refcount++; free(path); return(obj); + } else if (fd == -1) { + free(path); + return(NULL); } dbg("loading \"%s\"", path); -- 2.41.0