]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla bug 1068: Check object pointer isn't NULL before calling methods/delete
authoradrian <>
Sat, 2 Sep 2006 09:35:52 +0000 (09:35 +0000)
committeradrian <>
Sat, 2 Sep 2006 09:35:52 +0000 (09:35 +0000)
This doesn't fix the core of the bug (no error page being generated) but
it does fix the crash.

src/ftp.cc

index e1b88f9590fafd58631159f0c21d8814168cf8d6..a0781fe500e16b149877e9f221d6aac337fa014e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.401 2006/08/25 15:22:34 serassio Exp $
+ * $Id: ftp.cc,v 1.402 2006/09/02 03:35:52 adrian Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -410,10 +410,12 @@ FtpStateData::~FtpStateData()
         ctrl.buf = NULL;
     }
 
-    if (!data.readBuf->isNull())
-        data.readBuf->clean();
+    if (data.readBuf) {
+        if (!data.readBuf->isNull())
+           data.readBuf->clean();
 
-    delete data.readBuf;
+        delete data.readBuf;
+    }
 
     if (pathcomps)
         wordlistDestroy(&pathcomps);