Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-08-24 08:38:39 +0400
committerChristopher Faylor <me@cgf.cx>2005-08-24 08:38:39 +0400
commit14c4d65ef1240b1c18db06c3030b4e0830b0c701 (patch)
tree0a651de83d4520bb1c08dd334792733560733975 /winsup/cygwin/fhandler_registry.cc
parentdb7f135b03afa5f8ee870f87d1727d69dade30ce (diff)
* cygheap.h (cygheap_types): Add HEAP_COMMUNE.
* fhandler_proc.cc: Use cygheap rather than user heap for allocation of filebuf throughout. * fhandler_registry.cc: Ditto. * fhandler_virtual.cc: Ditto. * fhandler_process.cc: Ditto. (get_mem_values): Use malloc/realloc/free rather than new. * pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than user heap. Avoid calling ReadFile when correct number of characters have been read or suffer buffer corruption. (_pinfo::fd): Allocate on cygwin heap rather than user heap. (_pinfo::fds): Ditto. (_pinfo::root): Ditto. (_pinfo::cwd): Ditto. (_pinfo::cmdline): Ditto. * devices.h (FH_DEV): New define. * devices.in: Detect lone /dev. * devices.cc: Regenerate. * path.cc (path_conv::check): Treat FH_DEV as a special case.
Diffstat (limited to 'winsup/cygwin/fhandler_registry.cc')
-rw-r--r--winsup/cygwin/fhandler_registry.cc9
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);