kerdat: don't leak a file descriptor

288             if (flock(fd, LOCK_SH)) {
289                     pr_perror("Can't take a lock\n");
>>> >>>     CID 92726:  Resource leaks  (RESOURCE_LEAK)
>>> >>>     Handle variable "fd" going out of scope leaks the handle.
290                     return -1;
291             }

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2015-05-01 14:06:00 +03:00 committed by Pavel Emelyanov
parent 8ac865f3ee
commit 59bb688033

View file

@ -287,7 +287,7 @@ int kerndat_fdinfo_has_lock()
if (flock(fd, LOCK_SH)) {
pr_perror("Can't take a lock");
return -1;
goto out;
}
pfd = open_proc(PROC_SELF, "fdinfo/%d", fd);