git://git.iain.cx/iain
/
nssm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Don't leak memory reading REG_SZ values.
[nssm.git]
/
registry.cpp
diff --git
a/registry.cpp
b/registry.cpp
index
cb0b3e6
..
0a74bd8
100644
(file)
--- 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 */
\r
if (type != REG_EXPAND_SZ) {
\r
memmove(data, buffer, buflen);
\r
+ HeapFree(GetProcessHeap(), 0, buffer);
\r
return 0;
\r
}
\r
\r