Do not call close() with a negative value

Check the value of *pidfilefd before calling close(*pidfilefd).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Stefan Berger 2018-05-14 16:37:56 -04:00
parent 5b63c5dbff
commit 39f684b39a

View File

@ -473,7 +473,8 @@ parse_pid_options(char *options, char **pidfile, int *pidfilefd)
error:
option_values_free(ovs);
close(*pidfilefd);
if (*pidfilefd >= 0)
close(*pidfilefd);
return -1;
}