1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-24 19:37:48 +03:00

tests/pkd: free socket wrapper string upon error

In e1a8b359c1 a missing `free` was
added to `pkd_cleanup_socket_wrapper` to free a string allocated
for the socket wrapper directory name.

Move that `free` such that it also runs in the error-out paths in
`pkd_cleanup_socket_wrapper`, to avoid a leak in those cases, too.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Jon Simons
2022-11-06 11:34:48 -05:00
committed by Jakub Jelen
parent abe222e1e8
commit 9514547c2a

View File

@@ -1011,12 +1011,12 @@ static int pkd_cleanup_socket_wrapper(void) {
goto errrmdir;
}
free(pkd_dargs.opts.socket_wrapper.mkdtemp_str);
goto out;
goto outfree;
errrmdir:
errrmfiles:
rc = -1;
outfree:
free(pkd_dargs.opts.socket_wrapper.mkdtemp_str);
out:
return rc;
}