-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have a memory leak at src/transport.c:474 #623
Comments
There are a couple places where |
Through the test, it is found that when the keepalive is configured with want_reply = 1, the memory leak will occur at the next time which _libssh2_transport_read(libssh2_sftp_open_ex) called. I guess the message from the server is not processed, while allocaing space mistakenly during the next reading. Can you tell us how to deal with this situation |
I see also the same memory leak. In our company we have a single sftp thread, for which we open and close sessions repeatedly. |
Hi, --- a/src/session.c 2021-10-11 15:29:54.768257700 +0100
+++ b/src/session.c 2021-10-13 06:51:50.788974100 +0100
@@ -1053,7 +1053,7 @@
}
/* Free payload buffer */
- if(session->packet.total_num) {
+ if(session->packet.payload) {
LIBSSH2_FREE(session, session->packet.payload);
} As I see it in closing a session, payload would need definitely to be freed, and a pointer should be NOT null, only if in use. However, I would think that the line may need a change from LIBSSH2_ALLOC to LIBSSH2_REALLOC if that part of the code is going to be used multiple times (as my analysis indicated at first glance) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I encounter the same memory leak in mly company with version 1.11.0 ... |
The text was updated successfully, but these errors were encountered: