From 43c83dc99ea38da2801ae54e28bdc272d47c27ca Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 29 Oct 2026 10:03:04 -0400 Subject: [PATCH] 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. --- NEWS | 2 ++ ext/standard/dns_win32.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 9e93da5c8d88..4156a9c46047 100644 --- a/NEWS +++ b/NEWS @@ -230,6 +230,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 4eb4b0e6e559..96a5e8562511 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; } /* }}} */