diff options
author | John Polstra <jdp@FreeBSD.org> | 1999-06-25 04:50:06 +0000 |
---|---|---|
committer | John Polstra <jdp@FreeBSD.org> | 1999-06-25 04:50:06 +0000 |
commit | d16ad2d05516a348d4cd56b3e3dd44f37cd45754 (patch) | |
tree | 7e34c0a861520e75cdf9fa3b69fb7a47cc27d21f /libexec/rtld-elf | |
parent | 962fdc466afdd71fb36d0c285205fd2876212b5e (diff) | |
download | src-d16ad2d05516a348d4cd56b3e3dd44f37cd45754.tar.gz src-d16ad2d05516a348d4cd56b3e3dd44f37cd45754.zip |
Fix a reference counting problem when using dlopen(NULL, ...).
PR: bin/12129
Notes
Notes:
svn path=/head/; revision=48208
Diffstat (limited to 'libexec/rtld-elf')
-rw-r--r-- | libexec/rtld-elf/rtld.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index fd46c2964b19..72ecab1f1eb5 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); |