Permalink
Browse files

fixes global memory leaks

  • Loading branch information...
c4milo committed Dec 29, 2011
1 parent 37c10d0 commit 6d02e59a7932c37ce6e9561c21fa78064e8d1bf7
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/multipartform.js
View
@@ -142,12 +142,13 @@ function MultiPartRequest(data, boundary) {
MultiPartRequest.prototype = {
_partNames: function() {
- partNames = []
- for (var name in this.data) {
- partNames.push(name)
+ var partNames = []
+ for (var name in this.data) {
+ partNames.push(name)
}
return partNames;
},
+
write: function(stream, callback) {
var partCount = 0, self = this;
@@ -157,8 +158,8 @@ MultiPartRequest.prototype = {
// Let each part write itself out to the stream
(function writePart() {
- partName = this.partNames[partCount];
- part = new Part(partName, self.data[partName], self.boundary);
+ var partName = this.partNames[partCount];
+ var part = new Part(partName, self.data[partName], self.boundary);
part.write(stream, function (err) {
if (err) {
callback(err);

0 comments on commit 6d02e59

Please sign in to comment.