loadpolicy: only close polFd if it is valid

It can be -1 at this point.

CID 1055562
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Ian Campbell authored and Konrad Rzeszutek Wilk committed 2016-02-29 10:48:49 -05:00
1 parent 1c3639323c
commit 95cb4bac96
1 file changed
+1 -1
+1 -1
View File
@@ -115,7 +115,7 @@ done:
if ( ret < 0 )
fprintf(stderr, "Unable to unmap policy memory: %s\n", strerror(errno));
}
if ( polFd )
if ( polFd >= 0 )
close(polFd);
if ( xch )
xc_interface_close(xch);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.