Cygwin: resolver: A few fixes for cygwin_query(), part 2

Make sure Windows ResultSet is free'd when dn_comp failed internally
This commit is contained in:
Anton Lavrentiev via Cygwin-patches 2022-01-18 19:07:55 -05:00 committed by Corinna Vinschen
parent 54f0590a66
commit 099d5a9a57
1 changed files with 5 additions and 4 deletions

View File

@ -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;
}
len = ptr - AnsPtr;
done:
DnsFree(pQueryResultsSet, DnsFreeRecordList);
len = ptr - AnsPtr;
done:
if (HFIXEDSZ <= AnsLength) {
ptr = AnsPtr;
PUTSHORT(Id, ptr);