mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
Improve status_msg_free().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@586 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -610,11 +610,7 @@ static STATUS_MESSAGE *parse_status_msg(SFTP_MESSAGE *msg){
|
|||||||
status->errormsg = string_to_char(status->error);
|
status->errormsg = string_to_char(status->error);
|
||||||
status->langmsg = string_to_char(status->lang);
|
status->langmsg = string_to_char(status->lang);
|
||||||
if (status->errormsg == NULL || status->langmsg == NULL) {
|
if (status->errormsg == NULL || status->langmsg == NULL) {
|
||||||
string_free(status->error);
|
status_msg_free(status);
|
||||||
string_free(status->lang);
|
|
||||||
SAFE_FREE(status->errormsg);
|
|
||||||
SAFE_FREE(status->langmsg);
|
|
||||||
SAFE_FREE(status);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -622,15 +618,15 @@ static STATUS_MESSAGE *parse_status_msg(SFTP_MESSAGE *msg){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void status_msg_free(STATUS_MESSAGE *status){
|
static void status_msg_free(STATUS_MESSAGE *status){
|
||||||
if(status->errormsg)
|
if (status == NULL) {
|
||||||
free(status->errormsg);
|
return;
|
||||||
if(status->error)
|
}
|
||||||
free(status->error);
|
|
||||||
if(status->langmsg)
|
string_free(status->errormsg);
|
||||||
free(status->langmsg);
|
string_free(status->langmsg);
|
||||||
if(status->lang)
|
SAFE_FREE(status->error);
|
||||||
free(status->lang);
|
SAFE_FREE(status->lang);
|
||||||
free(status);
|
SAFE_FREE(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SFTP_FILE *parse_handle_msg(SFTP_MESSAGE *msg){
|
static SFTP_FILE *parse_handle_msg(SFTP_MESSAGE *msg){
|
||||||
|
|||||||
Reference in New Issue
Block a user