mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
tests/pkd: free socket wrapper string upon error
Ine1a8b359c1a 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> (cherry picked from commit9514547c2a)
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