diff options
author | Xiang Xiao <xiaoxiang@xiaomi.com> | 2021-05-06 22:54:10 -0700 |
---|---|---|
committer | Jakub Jelen <jjelen@redhat.com> | 2021-05-12 16:01:18 +0200 |
commit | 43a31b81f20e5de401d5c0731bde7880367b0cec (patch) | |
tree | b19b3c2cf10f0b3e478cf7d1b465673da171e8e6 | |
parent | 46624648f98775aee109ab61d1995cbc14011d88 (diff) | |
download | libssh-43a31b81f20e5de401d5c0731bde7880367b0cec.tar.gz libssh-43a31b81f20e5de401d5c0731bde7880367b0cec.tar.xz libssh-43a31b81f20e5de401d5c0731bde7880367b0cec.zip |
examples/libssh_scp: Remove the duplication of free(loc->host)
and free sources at the end of program
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Change-Id: Ia6a51d52439722b46547449e85350b3193e5ba28
-rw-r--r-- | examples/libssh_scp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c index 906a9206..0508d494 100644 --- a/examples/libssh_scp.c +++ b/examples/libssh_scp.c @@ -105,10 +105,6 @@ static void location_free(struct location *loc) free(loc->user); } loc->user = NULL; - if (loc->host) { - free(loc->host); - } - loc->host = NULL; } free(loc); } @@ -451,5 +447,6 @@ close_dest: location_free(dest); end: ssh_finalize(); + free(sources); return r; } |