Search squid archive

Re: Squid 3.5.16 and vary loop objects (bug ?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/04/2016 8:51 p.m., joe wrote:
> amos  one think i notice 
> === modified file 'src/MemObject.cc'
> --- src/MemObject.cc	2016-01-01 00:14:27 +0000
> +++ src/MemObject.cc	2016-04-01 06:15:31 +0000
> @@ -136,8 +136,6 @@
>      HTTPMSGUNLOCK(request);
>  
>      ctx_exit(ctx);              /* must exit before we free mem->url */
> -
> -    safe_free(vary_headers); /*??????? do we need to clear (vary_headers)
> if yes then you forget to insert vary_headers.clear(); */
> +    vary_headers.clear();      /* missing for reason on patch
> squid-3.5-14016.patch */
>  }
> 

That was intentional. The line of code above was in an objects
destructor. The safe_free() used to be needed to prevent the C-style bit
of memory being leaked.

The new code uses a C++ smart pointer called SBuf and it automatically
does that memory releasing in destructors without an explicit clear()
being needed.

(You can add a clear() if you want. All it will do is waste a few CPU
cycles.)

Amos

_______________________________________________
squid-users mailing list
squid-users@xxxxxxxxxxxxxxxxxxxxx
http://lists.squid-cache.org/listinfo/squid-users




[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux