aboutsummaryrefslogtreecommitdiffstats
path: root/nanoftp.c
diff options
context:
space:
mode:
authorGaurav Gupta <g.gupta@samsung.com>2014-07-14 17:50:27 +0800
committerDaniel Veillard <veillard@redhat.com>2014-07-14 17:50:27 +0800
commit1811add768cabe36f763c960a40698418c5cbe47 (patch)
treedaa5083c3c70884c5a87ab56f7c76946cf565dd7 /nanoftp.c
parentc836ba66e57d4d9f90f1dc7a827625c99622408f (diff)
downloadandroid_external_libxml2-1811add768cabe36f763c960a40698418c5cbe47.tar.gz
android_external_libxml2-1811add768cabe36f763c960a40698418c5cbe47.tar.bz2
android_external_libxml2-1811add768cabe36f763c960a40698418c5cbe47.zip
Fix various Missing Null checks
For https://bugzilla.gnome.org/show_bug.cgi?id=732823
Diffstat (limited to 'nanoftp.c')
-rw-r--r--nanoftp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/nanoftp.c b/nanoftp.c
index ab1f685c..f467e5a0 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -1244,7 +1244,13 @@ xmlNanoFTPConnectTo(const char *server, int port) {
if (port <= 0)
return(NULL);
ctxt = (xmlNanoFTPCtxtPtr) xmlNanoFTPNewCtxt(NULL);
+ if (ctxt == NULL)
+ return(NULL);
ctxt->hostname = xmlMemStrdup(server);
+ if (ctxt->hostname == NULL) {
+ xmlNanoFTPFreeCtxt(ctxt);
+ return(NULL);
+ }
if (port != 0)
ctxt->port = port;
res = xmlNanoFTPConnect(ctxt);
@@ -1321,8 +1327,8 @@ xmlNanoFTPDele(void *ctx, const char *file) {
int len;
int res;
- if ((ctxt == NULL) || (ctxt->controlFd == INVALID_SOCKET) || (file == NULL)) return(-1);
- if (file == NULL) return (0);
+ if ((ctxt == NULL) || (ctxt->controlFd == INVALID_SOCKET) ||
+ (file == NULL)) return(-1);
/*
* Expected response code for DELE: