aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2019-10-28 13:32:49 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-09 16:38:36 +0100
commit7fe7203f06b7ddb7ab17ed0413e1dbe2ecdc79eb (patch)
tree709dc4fd7c68fdf610d3f1adb9af58421d25b033
parent02ed74711f6189694f44e99f58632f19526bdaea (diff)
downloadlibssh-7fe7203f06b7ddb7ab17ed0413e1dbe2ecdc79eb.tar.gz
libssh-7fe7203f06b7ddb7ab17ed0413e1dbe2ecdc79eb.tar.xz
libssh-7fe7203f06b7ddb7ab17ed0413e1dbe2ecdc79eb.zip
sftpserver: Use SSH_STRING_FREE()
Fixes T183 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com> (cherry picked from commit 449c0d66ccbd9e558cae0bc59a0d98bdb95160c0)
-rw-r--r--src/sftpserver.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/sftpserver.c b/src/sftpserver.c
index cd3f89e0..fd4f1d68 100644
--- a/src/sftpserver.c
+++ b/src/sftpserver.c
@@ -277,8 +277,8 @@ void sftp_client_message_free(sftp_client_message msg) {
SAFE_FREE(msg->filename);
SAFE_FREE(msg->submessage);
- ssh_string_free(msg->data);
- ssh_string_free(msg->handle);
+ SSH_STRING_FREE(msg->data);
+ SSH_STRING_FREE(msg->handle);
sftp_attributes_free(msg->attr);
ssh_buffer_free(msg->complete_message);
SAFE_FREE(msg->str_data);
@@ -309,11 +309,11 @@ int sftp_reply_name(sftp_client_message msg, const char *name,
buffer_add_attributes(out, attr) < 0 ||
sftp_packet_write(msg->sftp, SSH_FXP_NAME, out) < 0) {
ssh_buffer_free(out);
- ssh_string_free(file);
+ SSH_STRING_FREE(file);
return -1;
}
ssh_buffer_free(out);
- ssh_string_free(file);
+ SSH_STRING_FREE(file);
return 0;
}
@@ -368,27 +368,27 @@ int sftp_reply_names_add(sftp_client_message msg, const char *file,
if (msg->attrbuf == NULL) {
msg->attrbuf = ssh_buffer_new();
if (msg->attrbuf == NULL) {
- ssh_string_free(name);
+ SSH_STRING_FREE(name);
return -1;
}
}
if (ssh_buffer_add_ssh_string(msg->attrbuf, name) < 0) {
- ssh_string_free(name);
+ SSH_STRING_FREE(name);
return -1;
}
- ssh_string_free(name);
+ SSH_STRING_FREE(name);
name = ssh_string_from_char(longname);
if (name == NULL) {
return -1;
}
if (ssh_buffer_add_ssh_string(msg->attrbuf,name) < 0 ||
buffer_add_attributes(msg->attrbuf,attr) < 0) {
- ssh_string_free(name);
+ SSH_STRING_FREE(name);
return -1;
}
- ssh_string_free(name);
+ SSH_STRING_FREE(name);
msg->attr_num++;
return 0;
@@ -444,12 +444,12 @@ int sftp_reply_status(sftp_client_message msg, uint32_t status,
ssh_buffer_add_u32(out, 0) < 0 || /* language string */
sftp_packet_write(msg->sftp, SSH_FXP_STATUS, out) < 0) {
ssh_buffer_free(out);
- ssh_string_free(s);
+ SSH_STRING_FREE(s);
return -1;
}
ssh_buffer_free(out);
- ssh_string_free(s);
+ SSH_STRING_FREE(s);
return 0;
}