flock: possible pointer dereferences [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-03-27 14:40:42 +01:00
parent 31bfda07a4
commit 3c7fbc82da
1 changed files with 1 additions and 0 deletions

View File

@ -255,6 +255,7 @@ int main(int argc, char *argv[])
*/
if (!(open_flags & O_RDWR) &&
type != LOCK_SH &&
filename &&
access(filename, R_OK | W_OK) == 0) {
close(fd);