diff options
Diffstat (limited to 'winsup/cygwin/fhandler_registry.cc')
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index 885a35247..37bb63983 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -539,7 +539,10 @@ fhandler_registry::close () } } if (!hExeced && value_name) - cfree (value_name); + { + cfree (value_name); + value_name = NULL; + } return res; } @@ -562,7 +565,7 @@ fhandler_registry::fill_filebuf () goto value_not_found; } bufalloc = size; - filebuf = (char *) malloc (bufalloc); + filebuf = (char *) cmalloc (HEAP_BUF, bufalloc); error = RegQueryValueEx (handle, value_name, NULL, NULL, (BYTE *) filebuf, &size); @@ -579,7 +582,7 @@ fhandler_registry::fill_filebuf () do { bufalloc += 1000; - filebuf = (char *) realloc (filebuf, bufalloc); + filebuf = (char *) crealloc (filebuf, bufalloc); size = bufalloc; error = RegQueryValueEx (handle, value_name, NULL, &type, (BYTE *) filebuf, &size); |