diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-12-17 09:00:19 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-12-17 09:00:19 +0000 |
commit | ccf65be0a463f8813e1bafb5db7c6334a0b08b28 (patch) | |
tree | e2f5b5a62b5c7918b7e66ca8c42699deb6acc293 /lib | |
parent | 7dfef132243335b371e6743eadb01bb1002fcdd7 (diff) |
fixed minor memory leak when running out of memory
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -779,8 +779,10 @@ CURLcode Curl_ftp_done(struct connectdata *conn, CURLcode status) dlen = strlen(path)-flen; if(dlen) { ftp->prevpath = malloc(dlen + 1); - if(!ftp->prevpath) + if(!ftp->prevpath) { + free(path); return CURLE_OUT_OF_MEMORY; + } memcpy(ftp->prevpath, path, dlen); ftp->prevpath[dlen]=0; /* terminate */ infof(data, "Remembering we are in dir %s\n", ftp->prevpath); |