Explorar o código

Don't leak memory reading REG_SZ values.

Iain Patterson %!s(int64=13) %!d(string=hai) anos
pai
achega
e200c1086d
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      registry.cpp

+ 1 - 0
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;
   }