mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
rtld.c: avoid double-free on dso load failure in do_load_object()
The obj->path is assigned directly from the path argument, and load_object() frees the path on do_load_object() failure. Do not free it in obj_free() on the error path. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D60402
This commit is contained in:
1 parent
4445d03958
commit
274236ed08
1 file changed
+1
@@ -3027,6 +3027,7 @@ do_load_object(int fd, const char *name, char *path, struct stat *sbp,
|
||||
|
||||
errp:
|
||||
munmap(obj->mapbase, obj->mapsize);
|
||||
obj->path = NULL; /* obj->path is owned and freed by caller */
|
||||
obj_free(obj);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user