Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Commits

[master] ad1eb2f Fix memory leak I just introduced.

 

 

Varnish commits RSS feed   Index | Next | Previous | View Threaded


phk at varnish-cache

Aug 9, 2013, 4:55 AM

Post #1 of 1 (9 views)
Permalink
[master] ad1eb2f Fix memory leak I just introduced.

commit ad1eb2fd1877cd5f6d444faae8d9730dc5e7eb55
Author: Poul-Henning Kamp <phk [at] FreeBSD>
Date: Fri Aug 9 11:54:49 2013 +0000

Fix memory leak I just introduced.

Spotted by: Federico Schwindt

diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index b5649b6..651a77c 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -126,7 +126,7 @@ vmod_integer(const struct vrt_ctx *ctx, const char *p, VCL_INT i)
VCL_IP
vmod_ip(const struct vrt_ctx *ctx, VCL_STRING s, VCL_IP d)
{
- struct addrinfo hints, *res0;
+ struct addrinfo hints, *res0 = NULL;
const struct addrinfo *res;
int error;
char *p;
@@ -154,5 +154,7 @@ vmod_ip(const struct vrt_ctx *ctx, VCL_STRING s, VCL_IP d)
p = WS_Alloc(ctx->ws, VSA_Len(d));
AN(p);
memcpy(p, d, VSA_Len(d));
+ if (res0 != NULL)
+ freeaddrinfo(res0);
return (p);
}

_______________________________________________
varnish-commit mailing list
varnish-commit [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit

Varnish commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.