Fix memory leak of pidfile in case of error

Fix memory leak of pidfile in case of error.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Stefan Berger 2017-07-18 16:37:39 -04:00
parent 01aa2ed3af
commit c4b8d7b443

View File

@ -448,6 +448,7 @@ int
handle_pid_options(char *options)
{
char *pidfile = NULL;
int ret = 0;
if (!options)
return 0;
@ -456,11 +457,11 @@ handle_pid_options(char *options)
return -1;
if (pidfile_set(pidfile) < 0)
return -1;
ret = -1;
free(pidfile);
return 0;
return ret;
}
/*