[libxml2] Fix memory leak in nanoftp



commit 3b3d75028a1d60fa9650137bfac90e9b36ee6199
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Sep 6 01:31:31 2017 +0200

    Fix memory leak in nanoftp
    
    Found by OSS-Fuzz (testcase 5487741645094912). Free the user and
    password strings in xmlNanoFTPFreeCtxt.
    
    Also see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2727

 nanoftp.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/nanoftp.c b/nanoftp.c
index 2135ab9..5bc6555 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -511,6 +511,8 @@ xmlNanoFTPFreeCtxt(void * ctx) {
     if (ctxt->hostname != NULL) xmlFree(ctxt->hostname);
     if (ctxt->protocol != NULL) xmlFree(ctxt->protocol);
     if (ctxt->path != NULL) xmlFree(ctxt->path);
+    if (ctxt->user != NULL) xmlFree(ctxt->user);
+    if (ctxt->passwd != NULL) xmlFree(ctxt->passwd);
     ctxt->passive = 1;
     if (ctxt->controlFd != INVALID_SOCKET) closesocket(ctxt->controlFd);
     ctxt->controlFd = INVALID_SOCKET;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]