summaryrefslogtreecommitdiff
path: root/ext/http/01_http.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r--ext/http/01_http.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index 073cc7a7c..2e742d097 100644
--- a/ext/http/01_http.js
+++ b/ext/http/01_http.js
@@ -297,6 +297,13 @@
ws[_eventLoop]();
}
+ } else {
+ // Try to close "request" resource. It might have been already consumed,
+ // but if it hasn't been we need to close it here to avoid resource leak.
+ try {
+ SetPrototypeDelete(httpConn.managedResources, requestRid);
+ core.close(requestRid);
+ } catch { /* pass */ }
}
};
}