httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <jwool...@virginia.edu>
Subject Re: [PATCH] mod_deflate + mod_proxy bug
Date Wed, 09 Jun 2004 21:28:41 GMT
On Wed, 9 Jun 2004, Allan Edwards wrote:

> +            }
> +            else {
> +                /* this was a zero length response, remove gzip header bucket then pass
down the EOS */
> +                APR_BUCKET_REMOVE(APR_BRIGADE_FIRST(ctx->bb));
> +                APR_BUCKET_REMOVE(e);
> +                APR_BRIGADE_INSERT_TAIL(ctx->bb, e);
> +                return ap_pass_brigade(f->next, ctx->bb);
> +            }

I haven't looked at the entire context of this, but if you remove a bucket
(brigade_first(ctx->bb) from a brigade without deleting it and without
having any extra pointers to it, you'll leak memory.

Also, what happens if e *is* the first bucket in the brigade?  Can that
occur?  I think that by coincidence given the implementation of
APR_BUCKET_REMOVE, nothing bad would happen by double-removing a given
bucket twice in a row, but in general that seems like a bad idea and
should be avoided.

--Cliff

Mime
View raw message