mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 04:29:02 -04:00
Fix unhappy path cleanup.
The whole while (cnt-- >= 0) idiom is busted since cnt started at 0 and if the first call to PyUnicode_FromStringAndSize() fails then we're attempting to access -1.
This commit is contained in:
parent
daca80f1cb
commit
a7aa51d8d5
@ -1274,8 +1274,8 @@ python_runtime_http_request(void *addr, struct http_request *req)
|
||||
req->cgroups[idx].rm_eo - req->cgroups[idx].rm_so);
|
||||
|
||||
if (cargs[cnt] == NULL) {
|
||||
while (cnt-- >= 0)
|
||||
Py_XDECREF(cargs[cnt]);
|
||||
while (cnt >= 0)
|
||||
Py_XDECREF(cargs[cnt--]);
|
||||
kore_python_log_error("http request");
|
||||
http_response(req,
|
||||
HTTP_STATUS_INTERNAL_ERROR, NULL, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user