mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
Add more error checks to sftp_message_new().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@574 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -284,7 +284,7 @@ int sftp_get_error(SFTP_SESSION *sftp) {
|
||||
}
|
||||
|
||||
static SFTP_MESSAGE *sftp_message_new(SFTP_SESSION *sftp){
|
||||
SFTP_MESSAGE *msg;
|
||||
SFTP_MESSAGE *msg = NULL;
|
||||
|
||||
sftp_enter_function();
|
||||
|
||||
@@ -292,10 +292,15 @@ static SFTP_MESSAGE *sftp_message_new(SFTP_SESSION *sftp){
|
||||
if (msg == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
ZERO_STRUCTP(msg);
|
||||
|
||||
msg->payload = buffer_new();
|
||||
if (msg->payload == NULL) {
|
||||
SAFE_FREE(msg);
|
||||
return NULL;
|
||||
}
|
||||
msg->sftp = sftp;
|
||||
|
||||
memset(msg,0,sizeof(*msg));
|
||||
msg->payload=buffer_new();
|
||||
msg->sftp=sftp;
|
||||
sftp_leave_function();
|
||||
return msg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user