aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang Xiao <xiaoxiang@xiaomi.com>2021-05-06 22:54:10 -0700
committerJakub Jelen <jjelen@redhat.com>2021-05-12 16:01:18 +0200
commit43a31b81f20e5de401d5c0731bde7880367b0cec (patch)
treeb19b3c2cf10f0b3e478cf7d1b465673da171e8e6
parent46624648f98775aee109ab61d1995cbc14011d88 (diff)
downloadlibssh-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.c5
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;
}