summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1999-06-25 04:50:06 +0000
committerjdp <jdp@FreeBSD.org>1999-06-25 04:50:06 +0000
commit3ff496fa33a0b1b686515e450755211becc479c9 (patch)
treedd0deb8c904f1daacdbb947a8ab71f9e4c53029d /libexec
parent2be78ea16b1b57cbbbb05a25df4da4e456886b1e (diff)
downloadFreeBSD-src-3ff496fa33a0b1b686515e450755211becc479c9.zip
FreeBSD-src-3ff496fa33a0b1b686515e450755211becc479c9.tar.gz
Fix a reference counting problem when using dlopen(NULL, ...).
PR: bin/12129
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index fd46c29..72ecab1 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -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);
OpenPOWER on IntegriCloud