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:
authorCorinna Vinschen <corinna@vinschen.de>2000-10-31 22:59:16 +0300
committerCorinna Vinschen <corinna@vinschen.de>2000-10-31 22:59:16 +0300
commit8e32a18e796dc9f8a0f92b720cf12aa1bf9dc5b5 (patch)
tree427c37b056a521020aca2b120549ae9739d2dfdd /winsup/cygwin/fhandler_tape.cc
parentdd07a42567d385dcb9837830f38295308f6500fc (diff)
* fhandler_tape.cc (fhandler_dev_tape::open): Fix memory allocation.
Use Cygwin heap instead of user heap. (fhandler_dev_tape::ioctl): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_tape.cc')
-rw-r--r--winsup/cygwin/fhandler_tape.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc
index 279c7fc37..1dd15e577 100644
--- a/winsup/cygwin/fhandler_tape.cc
+++ b/winsup/cygwin/fhandler_tape.cc
@@ -16,6 +16,7 @@ details. */
#include <unistd.h>
#include <sys/mtio.h>
+#include "cygheap.h"
#include "cygerrno.h"
#include "fhandler.h"
#include "path.h"
@@ -88,7 +89,7 @@ fhandler_dev_tape::open (const char *path, int flags, mode_t)
varblkop = get.mt_dsreg == 0;
if (devbufsiz > 1L)
- devbuf = new char [ devbufsiz ];
+ devbuf = (char *) cmalloc (HEAP_BUF, devbufsiz);
/* The following rewind in position 0 solves a problem which appears
* in case of multi volume archives: The last ReadFile on first medium
@@ -348,7 +349,7 @@ fhandler_dev_tape::ioctl (unsigned int cmd, void *buf)
size = get.mt_maxblksize;
ret = NO_ERROR;
}
- char *buf = new char [ size ];
+ char *buf = (char *) cmalloc (HEAP_BUF, size);
if (!buf)
{
ret = ERROR_OUTOFMEMORY;
@@ -358,7 +359,7 @@ fhandler_dev_tape::ioctl (unsigned int cmd, void *buf)
{
memcpy(buf,devbuf + devbufstart, devbufend - devbufstart);
devbufend -= devbufstart;
- delete [] devbuf;
+ cfree (devbuf);
}
else
devbufend = 0;