浏览代码

Don't leak memory reading REG_SZ values.

Iain Patterson 13 年之前
父节点
当前提交
e200c1086d
共有 1 个文件被更改,包括 1 次插入0 次删除
  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;
   }