From e200c1086d1f9fbf85d40211d2284d29661c5277 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 3 Feb 2011 19:00:19 +0000 Subject: [PATCH 1/1] Don't leak memory reading REG_SZ values. --- registry.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/registry.cpp b/registry.cpp index cb0b3e6..0a74bd8 100644 --- a/registry.cpp +++ b/registry.cpp @@ -124,6 +124,7 @@ int expand_parameter(HKEY key, char *value, char *data, unsigned long datalen) { /* Technically we shouldn't expand environment strings from REG_SZ values */ if (type != REG_EXPAND_SZ) { memmove(data, buffer, buflen); + HeapFree(GetProcessHeap(), 0, buffer); return 0; } -- 2.20.1