diff --git a/mount.c b/mount.c index d30bbfae1..66e263c1f 100644 --- a/mount.c +++ b/mount.c @@ -787,8 +787,10 @@ int mntns_collect_root(pid_t pid) pfd = open_pid_proc(pid); ret = readlinkat(pfd, "root", path, sizeof(path) - 1); - if (ret < 0) + if (ret < 0){ + close_pid_proc(); return ret; + } path[ret] = '\0';