From 0938d397be0b4b5da67a235d7e6ea9d01f2b7d08 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 5 Nov 2019 13:14:12 +0100 Subject: [PATCH] examples: Use SSH_STRING_FREE_CHAR() Fixes T183 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- examples/authentication.c | 2 +- examples/libssh_scp.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/authentication.c b/examples/authentication.c index 375987af..7c47c8bd 100644 --- a/examples/authentication.c +++ b/examples/authentication.c @@ -234,7 +234,7 @@ int authenticate_console(ssh_session session) banner = ssh_get_issue_banner(session); if (banner) { printf("%s\n",banner); - ssh_string_free_char(banner); + SSH_STRING_FREE_CHAR(banner); } return rc; diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c index fbb0bc2e..7a30b37f 100644 --- a/examples/libssh_scp.c +++ b/examples/libssh_scp.c @@ -303,7 +303,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { fprintf(stderr, "Error: %s\n", ssh_get_error(src->session)); - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); return -1; } } while(r != SSH_SCP_REQUEST_NEWFILE); @@ -316,7 +316,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { fprintf(stderr, "error: %s\n", ssh_get_error(dest->session)); - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); ssh_scp_free(dest->scp); dest->scp = NULL; return -1; @@ -331,7 +331,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { if (src->is_ssh) { ssh_scp_deny_request(src->scp, "Cannot open local file"); } - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); return -1; } } @@ -347,7 +347,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { fprintf(stderr, "Error reading scp: %s\n", ssh_get_error(src->session)); - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); return -1; } @@ -364,7 +364,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { fprintf(stderr, "Error reading file: %s\n", strerror(errno)); - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); return -1; } } @@ -377,7 +377,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { ssh_get_error(dest->session)); ssh_scp_free(dest->scp); dest->scp = NULL; - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); return -1; } } else { @@ -386,7 +386,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { fprintf(stderr, "Error writing in local file: %s\n", strerror(errno)); - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); return -1; } } @@ -394,7 +394,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive) { } while(total < size); - ssh_string_free_char(filename); + SSH_STRING_FREE_CHAR(filename); printf("wrote %zu bytes\n", total); return 0; }