From: wessels <> Date: Thu, 12 Sep 1996 04:40:15 +0000 (+0000) Subject: NULL handler before calling it in InvokeHandlers() X-Git-Tag: SQUID_3_0_PRE1~5836 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63cc928438e64faa7f3dbd215ebfe03b48f02e01;p=thirdparty%2Fsquid.git NULL handler before calling it in InvokeHandlers() --- diff --git a/src/store.cc b/src/store.cc index 259d0828e6..3271b50349 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.100 1996/09/05 22:14:07 wessels Exp $ + * $Id: store.cc,v 1.101 1996/09/11 22:40:15 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -965,22 +965,22 @@ static void InvokeHandlers(e) { int i; MemObject *mem = e->mem_obj; - + struct pentry *p = NULL; + PIF handler = NULL; + void *data = NULL; /* walk the entire list looking for valid handlers */ for (i = 0; i < (int) mem->pending_list_size; i++) { - if (mem->pending[i] && mem->pending[i]->handler) { - /* - * Once we call the handler, it is no longer needed - * until the write process sends all available data - * from the object entry. - */ - (mem->pending[i]->handler) - (mem->pending[i]->fd, e, mem->pending[i]->data); - safe_free(mem->pending[i]); - mem->pending[i] = NULL; - } + p = mem->pending[i]; + if (p == NULL) + continue; + if ((handler = p->handler) == NULL) + continue; + data = p->data; + memset(p, '\0', sizeof(struct pentry)); + safe_free(p); + mem->pending[i] = NULL; + handler(mem->pending[i]->fd, e, data); } - } /* Mark object as expired */