Re: squid-1.NOVM.21: FATAL: Somebody is putting a NULL pointer!

From: Miquel van Smoorenburg <miquels@dont-contact.us>
Date: 18 Mar 1998 17:43:57 +0100

In article <350FE724.2781@syseca.fr>,
Philippe Michel <Philippe.Michel@syseca.fr> wrote:
>In store.c, in destroy_MemObject():
>
>put_free_8k_page(mem->e_abort_msg);
>
>should probably be:
>
>if (mem->e_abort_msg != NULL)
> put_free_8k_page(mem->e_abort_msg);

Hmm, I've just compared destroy_MemObject() in squid.NOVM and squid-vanilla,
and they are just a bit different.

wrt squid-vanilla, squid.NOVM misses the line:

        destroy_MemObjectData(mem);

isn't that needed?

and squid.NOVM has

        put_free_8k_page(mem->e_abort_msg);

while the standard squid has

        safe_free(mem->e_abort_msg);

Since safe_free also sets mem->e_abort_msg to NULL, shouldn't the patch
look like:

--- store.c.orig Wed Mar 18 17:42:15 1998
+++ store.c Wed Mar 18 17:43:05 1998
@@ -277,7 +277,10 @@
     safe_free(mem->clients);
     safe_free(mem->mime_hdr);
     safe_free(mem->reply);
- put_free_8k_page(mem->e_abort_msg);
+ if (mem->e_abort_msg) {
+ put_free_8k_page(mem->e_abort_msg);
+ mem->e_abort_msg = NULL;
+ }
     safe_free(mem->log_url);
     requestUnlink(mem->request);
     mem->request = NULL;

Thanks anyway - hopefully this works :)

Mike.

-- 
 Miquel van Smoorenburg |  
    miquels@cistron.nl  |  Luck is when preparation meets opportunity
Received on Wed Mar 18 1998 - 08:51:26 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:39:25 MST