From 99651523dea8d12dcca03c215acbba301fc821c6 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 16 Sep 2009 13:48:11 +0000 Subject: [PATCH] fix memory leak in resolver --- src/core/ngx_resolver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c index 2b53ee07e..116734b28 100644 --- a/src/core/ngx_resolver.c +++ b/src/core/ngx_resolver.c @@ -1149,6 +1149,8 @@ ngx_resolver_process_a(ngx_resolver_t *r, u_char *buf, size_t last, goto failed; } + ngx_resolver_free(r, name.data); + if (code == 0 && nan == 0) { code = 3; /* NXDOMAIN */ } @@ -1400,6 +1402,8 @@ failed: /* unlock name mutex */ + ngx_resolver_free(r, name.data); + return; }