mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 18:50:28 +09: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;
|
goto errrmdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(pkd_dargs.opts.socket_wrapper.mkdtemp_str);
|
goto outfree;
|
||||||
|
|
||||||
goto out;
|
|
||||||
errrmdir:
|
errrmdir:
|
||||||
errrmfiles:
|
errrmfiles:
|
||||||
rc = -1;
|
rc = -1;
|
||||||
|
outfree:
|
||||||
|
free(pkd_dargs.opts.socket_wrapper.mkdtemp_str);
|
||||||
out:
|
out:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user