mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-01-17 07:23:39 +00:00
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:
parent
01aa2ed3af
commit
c4b8d7b443
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user