summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-04-13 23:19:06 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-04-13 23:22:38 +0900
commit8e07c229862877d34d5b0c0b37e81bd06a95d117 (patch)
tree1b47c61196c138bde18ec8f5c94463a503f58276
parent8acdd39befd1ffe7441502020196069a0d71b0f4 (diff)
downloadkasablanca-8e07c229862877d34d5b0c0b37e81bd06a95d117.tar.gz
kasablanca-8e07c229862877d34d5b0c0b37e81bd06a95d117.zip
Fixed cppcheck errors in ftplib.cpp. This solves #3.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit d08b667172be0b6fdc3cdf7723205a7f5e12cfd4)
-rw-r--r--src/ftplib.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ftplib.cpp b/src/ftplib.cpp
index def17f9..94d5fff 100644
--- a/src/ftplib.cpp
+++ b/src/ftplib.cpp
@@ -756,6 +756,7 @@ int ftplib::FtpOpenPort(netbuf *nControl, netbuf **nData, int mode, int dir, cha
{
FtpClose(*nData);
*nData = NULL;
+ free(ctrl);
return -1;
}
@@ -851,9 +852,10 @@ int ftplib::FtpOpenPasv(netbuf *nControl, netbuf **nData, int mode, int dir, cha
}
if (nControl->dir != FTPLIB_CONTROL) return -1;
- sprintf(cmd,"%s\r\n",cmd);
- if (nControl->tlsctrl) ret = SSL_write(nControl->ssl,cmd,strlen(cmd));
- else ret = write(nControl->handle,cmd,strlen(cmd));
+ char buf[256];
+ sprintf(buf,"%s\r\n",cmd);
+ if (nControl->tlsctrl) ret = SSL_write(nControl->ssl,buf,strlen(buf));
+ else ret = write(nControl->handle,buf,strlen(buf));
if (ret <= 0)
{
perror("write");