Commit dad8d9b
committed
Fix reference leak in ctypes _build_result()
In _ctypes._build_result(), a result tuple is allocated when numretvals > 1.
If v becomes NULL during result construction, the function returns early
without DECREF'ing the tuple, leaking a reference.
Add Py_XDECREF(tup) before returning when numretvals > 1 and v == NULL.
Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>1 parent 50ecd6b commit dad8d9b
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4557 | 4557 | | |
4558 | 4558 | | |
4559 | 4559 | | |
| 4560 | + | |
4560 | 4561 | | |
4561 | 4562 | | |
4562 | 4563 | | |
| |||
0 commit comments