From: wessels <> Date: Fri, 27 Mar 1998 10:23:05 +0000 (+0000) Subject: We only need to return IF the callback is made. This should X-Git-Tag: SQUID_3_0_PRE1~3743 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26720a7cee2e9a656ab6be201e148bc84572f080;p=thirdparty%2Fsquid.git We only need to return IF the callback is made. This should fix the disk FD leak! --- diff --git a/src/disk.cc b/src/disk.cc index 21c1563dca..0b132af249 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -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);