fix memory leak
we must not assign the pointer a NULL since it keeps allocated data and at least parts of an error string
This commit is contained in:
@@ -1005,12 +1005,10 @@ scp_send(LIBSSH2_SESSION * session, const char *path, int mode,
|
|||||||
*/
|
*/
|
||||||
LIBSSH2_FREE(session, session->scpSend_err_msg);
|
LIBSSH2_FREE(session, session->scpSend_err_msg);
|
||||||
session->scpSend_err_msg = NULL;
|
session->scpSend_err_msg = NULL;
|
||||||
goto scp_send_error;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL,
|
libssh2_error(session, LIBSSH2_ERROR_SCP_PROTOCOL,
|
||||||
"failed waiting for ACK");
|
"failed waiting for ACK");
|
||||||
session->scpSend_err_msg = NULL;
|
|
||||||
goto scp_send_error;
|
goto scp_send_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user