]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
We only need to return IF the callback is made. This should
authorwessels <>
Fri, 27 Mar 1998 10:23:05 +0000 (10:23 +0000)
committerwessels <>
Fri, 27 Mar 1998 10:23:05 +0000 (10:23 +0000)
fix the disk FD leak!

src/disk.cc

index 21c1563dcad59521f45ef1f49fbf3ca79311be49..0b132af249440fa8f9a03b7458ced67c88c5ac95 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: disk.cc,v 1.111 1998/03/05 01:11:22 wessels Exp $
+ * $Id: disk.cc,v 1.112 1998/03/27 03:23:05 wessels Exp $
  *
  * DEBUG: section 6     Disk I/O Routines
  * AUTHOR: Harvest Derived
@@ -405,13 +405,14 @@ diskHandleWriteComplete(void *data, int len, int errcode)
            do_callback = 0;
        if (fdd->wrt_handle_data != NULL)
            cbdataUnlock(fdd->wrt_handle_data);
-       if (do_callback)
+       if (do_callback) {
            fdd->wrt_handle(fd, status, len, fdd->wrt_handle_data);
-       /*
-        * NOTE, this callback can close the FD, so we must
-        * not touch 'F', 'fdd', etc. after this.
-        */
-       return;
+           /*
+            * NOTE, this callback can close the FD, so we must
+            * not touch 'F', 'fdd', etc. after this.
+            */
+           return;
+       }
     }
     if (do_close)
        file_close(fd);