[newlib-cygwin/cygwin-3_3-branch] Cygwin: resolver: A few fixes for cygwin_query(), part 2
Corinna Vinschen
corinna@sourceware.org
Wed Jan 19 07:55:22 GMT 2022
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=aa51dd3b92082c829cc1b49eae485891ea2d170b
commit aa51dd3b92082c829cc1b49eae485891ea2d170b
Author: Anton Lavrentiev via Cygwin-patches <cygwin-patches@cygwin.com>
Date: Tue Jan 18 19:07:55 2022 -0500
Cygwin: resolver: A few fixes for cygwin_query(), part 2
Make sure Windows ResultSet is free'd when dn_comp failed internally
Diff:
---
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 dce856076..cd56be45c 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);
More information about the Cygwin-cvs
mailing list