aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-07-25 18:09:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-07-25 18:09:57 +0000
commit240bfaa69e474da26e7f2ff4244f1e8d6a3a9234 (patch)
tree3fdc77a031bde033b2ccd3ebd55d9cbe01469ab8 /src/main.c
parent7dc48e57a6f4d4843c6d1bc2f611368d30aae295 (diff)
properly free data returned by aprintf(), and bring back the code to be
independent of libssh2 version as the client code isn't really meant to adapt to such build-time constraints.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 405ee3854..c7669ad11 100644
--- a/src/main.c
+++ b/src/main.c
@@ -4694,19 +4694,19 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
my_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
my_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);
}
-#ifdef HAVE_LIBSSH2_KNOWNHOST_API
else {
char *home = homedir();
char *file = aprintf("%s/%sssh/known_hosts", home, DOT_CHAR);
- if(home && file) {
+ if(home)
free(home);
+
+ if(file) {
my_setopt_str(curl, CURLOPT_SSH_KNOWNHOSTS, file);
- /* XXX do we need to free file here? */
+ curl_free(file);
}
else
return CURLE_OUT_OF_MEMORY;
}
-#endif
if(config->no_body || config->remote_time) {
/* no body or use remote time */