git: 11137153ab90 - stable/14 - fdlopen(3): do not create a new object mapping if already loaded
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Feb 2024 00:24:31 UTC
The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=11137153ab90c38cc5e9993f5c65491c47705024 commit 11137153ab90c38cc5e9993f5c65491c47705024 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-02-22 01:18:06 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-02-29 00:24:06 +0000 fdlopen(3): do not create a new object mapping if already loaded PR: 277169 (cherry picked from commit 452c5e9995ab4cd6c7ea230cffe0c53bfa65c1ab) --- libexec/rtld-elf/rtld.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d32c80debc1d..f11fe8afcc32 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2742,8 +2742,9 @@ load_object(const char *name, int fd_u, const Obj_Entry *refobj, int flags) if (obj->ino == sb.st_ino && obj->dev == sb.st_dev) break; } - if (obj != NULL && name != NULL) { - object_add_name(obj, name); + if (obj != NULL) { + if (name != NULL) + object_add_name(obj, name); free(path); close(fd); return (obj);