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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user