Commit 59bb6880 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8ac865f3
...@@ -287,7 +287,7 @@ int kerndat_fdinfo_has_lock() ...@@ -287,7 +287,7 @@ int kerndat_fdinfo_has_lock()
if (flock(fd, LOCK_SH)) { if (flock(fd, LOCK_SH)) {
pr_perror("Can't take a lock"); pr_perror("Can't take a lock");
return -1; goto out;
} }
pfd = open_proc(PROC_SELF, "fdinfo/%d", fd); pfd = open_proc(PROC_SELF, "fdinfo/%d", fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment