Commit b1757690220 for php
commit b175769022010659c721705ef1c12922f6c00e53
Author: Ilia Alshanetsky <ilia@ilia.ws>
Date: Thu Oct 29 10:03:04 2026 -0400
ext/standard: Free Windows DNS query results
Successful checkdnsrr() and dns_check_record() calls retain their native DNS
record lists. Release the list before returning.
Closes GH-25035
diff --git a/NEWS b/NEWS
index 6532e398594..de5109dd05c 100644
--- a/NEWS
+++ b/NEWS
@@ -236,6 +236,8 @@ PHP NEWS
properties). (Lazizbek Ergashev)
- Standard:
+ . Fixed memory leaks in checkdnsrr() and dns_check_record() on Windows.
+ (Ilia Alshanetsky)
. Fixed bug GH-24308 (Request shutdown calls closelog() even when syslog
was not opened by PHP). (lazerg)
. Fixed bug GH-24399 (usleep() and time_nanosleep() ignore queued APCs on
diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c
index 4eb4b0e6e55..96a5e856251 100644
--- a/ext/standard/dns_win32.c
+++ b/ext/standard/dns_win32.c
@@ -137,6 +137,8 @@ PHP_FUNCTION(dns_check_record)
RETURN_FALSE;
}
+ DnsRecordListFree(pResult, DnsFreeRecordListDeep);
+
RETURN_TRUE;
}
/* }}} */