vmod memory allocation problem

Rogier 'DocWilco' Mulhuijzen drwilco at drwilco.net
Mon May 20 07:09:22 CEST 2013


Or WS_Alloc if you know how much you need to allocate beforehand.
On May 19, 2013 7:26 PM, "Jammy" <jammy.linux at gmail.com> wrote:

>
> Yes, it will result in memory leakage.
>
> I recommend to use WS_Reserve to allocate your memory within your VMOD.
>
> Best regards
>
>
> On 19 May, 2013, at 4:59 PM, flygoast wrote:
>
> hi, guys,
>
> I'm newbie in varnish vmod development.
>
> I'am comfusing when I return a char * pointting to a block of memory
> malloced from heap, Whether resultting in a memory leak?
>
> Such as:
>
> char *
>
> vmod_foo(struct sess *sp, struct vmod_priv *priv)
>
> {
>
> return strdup("foo");
>
> }
>
> Thank you!
>
>
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>
>
> ----------------------------------
> Best wishes,
> Jammy
>
>
>
>
>
>
>
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20130520/22ce6061/attachment.html>


More information about the varnish-dev mailing list