public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: resolver: A few fixes for cygwin_query(), part 2
@ 2022-01-19  0:07 Anton Lavrentiev
  2022-01-19  7:55 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Lavrentiev @ 2022-01-19  0:07 UTC (permalink / raw)
  To: cygwin-patches

Make sure Windows ResultSet is free'd when dn_comp failed internally
---
 winsup/cygwin/libc/minires-os-if.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/libc/minires-os-if.c b/winsup/cygwin/libc/minires-os-if.c
index 5da1c0c55..c6fde776a 100644
--- a/winsup/cygwin/libc/minires-os-if.c
+++ b/winsup/cygwin/libc/minires-os-if.c
@@ -246,8 +246,7 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
       statp->res_h_errno = NO_RECOVERY;
       break;
     }
-    len = -1;
-    goto done;
+    return -1;
   }
 
   ptr = AnsPtr + HFIXEDSZ; /* Skip header */
@@ -293,10 +292,12 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
     rr = rr->pNext;
   }
 
-  DnsFree(pQueryResultsSet, DnsFreeRecordList);
-
   len = ptr - AnsPtr;
+
 done:
+
+  DnsFree(pQueryResultsSet, DnsFreeRecordList);
+
   if (HFIXEDSZ <= AnsLength) {
     ptr = AnsPtr;
     PUTSHORT(Id, ptr);
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Cygwin: resolver: A few fixes for cygwin_query(), part 2
  2022-01-19  0:07 [PATCH] Cygwin: resolver: A few fixes for cygwin_query(), part 2 Anton Lavrentiev
@ 2022-01-19  7:55 ` Corinna Vinschen
  0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2022-01-19  7:55 UTC (permalink / raw)
  To: cygwin-patches

On Jan 18 19:07, Anton Lavrentiev via Cygwin-patches wrote:
> Make sure Windows ResultSet is free'd when dn_comp failed internally
> ---
>  winsup/cygwin/libc/minires-os-if.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Great, thanks!  I pushed all your resolver patches.


Corinna

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] Cygwin: resolver: A few fixes for cygwin_query(), part 2
@ 2022-01-19 13:12 Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 0 replies; 3+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2022-01-19 13:12 UTC (permalink / raw)
  To: cygwin-patches

> Great, thanks!  I pushed all your resolver patches.

Thank you!  I'll be submitting the last tiny little one in a sec :-)

Anton Lavrentiev
Contractor NIH/NLM/NCBI


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-19 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19  0:07 [PATCH] Cygwin: resolver: A few fixes for cygwin_query(), part 2 Anton Lavrentiev
2022-01-19  7:55 ` Corinna Vinschen
2022-01-19 13:12 Lavrentiev, Anton (NIH/NLM/NCBI) [C]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).