summaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-04-01 12:15:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-04-01 12:15:37 +0000
commita06b36dee05e89c2886f6a77a007087382d42e0e (patch)
tree1b5324d14aa9fadef8bbafb23762f21b55386bc7 /lib/ftp.c
parent18e1bee8d55087681fc3d9ffba58ffedbf58ee6e (diff)
downloadcurl-a06b36dee05e89c2886f6a77a007087382d42e0e.tar.gz
- Andre Guibert de Bruet fixed a NULL pointer use in an infof() call if a
strdup() call failed.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 0e75a424d..5282204a7 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3214,7 +3214,8 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
ftpc->prevpath=strdup("");
free(path);
}
- infof(data, "Remembering we are in dir \"%s\"\n", ftpc->prevpath);
+ if(ftpc->prevpath)
+ infof(data, "Remembering we are in dir \"%s\"\n", ftpc->prevpath);
}
else {
ftpc->prevpath = NULL; /* no path */