mirror of
https://github.com/stefanberger/swtpm.git
synced 2026-02-04 21:19:14 +00:00
swtpm_ioctl: Free variable before parsing it to avoid memory leak (Coverity)
Avoid a memory leaks if --tcp is provided multiple times by freeing the previously allocated memory in the tcp_hostname variable. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
f1306a6313
commit
c9660fee88
@ -967,6 +967,7 @@ int main(int argc, char *argv[])
|
||||
tpm_device = optarg;
|
||||
break;
|
||||
case 'T':
|
||||
free(tcp_hostname);
|
||||
if (parse_tcp_optarg(optarg, &tcp_hostname, &tcp_port) < 0)
|
||||
return EXIT_FAILURE;
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user