fix : modify ssh_connector_free to accept NULL values

Signed-off-by: Nikhil V <nikhilgreyshines@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Nikhil V
2025-12-06 11:19:17 +05:30
committed by Jakub Jelen
parent 4feb0dd79d
commit 79966eb924

View File

@@ -133,10 +133,13 @@ ssh_connector ssh_connector_new(ssh_session session)
* Any channel callbacks and poll objects associated with the @p connector
* are removed and freed before the connector structure itself is released.
*
* @param[in] connector The connector to free. Must not be NULL.
* @param[in] connector The connector to free.
*/
void ssh_connector_free (ssh_connector connector)
{
if (connector == NULL) {
return;
}
if (connector->in_channel != NULL) {
ssh_remove_channel_callbacks(connector->in_channel,
&connector->in_channel_cb);