Browse Source

delete[] instead of delete for arrays.

v0.7.4-release
Ryan Dahl 15 years ago
parent
commit
663deb3828
  1. 2
      src/child_process.cc
  2. 2
      src/file.cc
  3. 2
      src/net.cc
  4. 4
      src/node.cc

2
src/child_process.cc

@ -79,7 +79,7 @@ Handle<Value> ChildProcess::Write(const Arguments& args) {
ssize_t written = DecodeWrite(buf, len, args[0], enc);
assert(written == len);
int r = child->Write(buf, len);
delete buf;
delete [] buf;
return r == 0 ? True() : False();
}

2
src/file.cc

@ -146,7 +146,7 @@ EIOPromise::After (eio_req *req)
argc = 1;
argv[0] = Integer::New(req->result);
assert(req->ptr2);
delete req->ptr2;
delete [] req->ptr2;
break;
case EIO_STAT:

2
src/net.cc

@ -356,7 +356,7 @@ Handle<Value> Connection::Send(const Arguments& args) {
ssize_t written = DecodeWrite(buf, len, args[0], enc);
assert(written == len);
connection->Send(buf, written);
delete buf;
delete [] buf;
return scope.Close(Integer::New(written));
}

4
src/node.cc

@ -69,7 +69,7 @@ Local<Value> Encode(const void *buf, size_t len, enum encoding encoding) {
twobytebuf[i] = cbuf[i];
}
Local<String> chunk = String::New(twobytebuf, len);
delete twobytebuf; // TODO use ExternalTwoByteString?
delete [] twobytebuf; // TODO use ExternalTwoByteString?
return scope.Close(chunk);
}
@ -146,7 +146,7 @@ ssize_t DecodeWrite(char *buf, size_t buflen,
buf[i] = b[0];
}
delete twobytebuf;
delete [] twobytebuf;
return buflen;
}

Loading…
Cancel
Save