diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2021-02-16 23:17:51 -0600 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2021-02-17 12:05:35 -0600 |
commit | 6635c6d59163974c7d3cfba014c3c522bdb5c99f (patch) | |
tree | 8c4ff8674667edfd07ca1b0e971c96514e0fa01e /numpy/f2py/cfuncs.py | |
parent | 5ca0ef6272ef3eabe2feb4049b7cb05a52516495 (diff) | |
download | numpy-6635c6d59163974c7d3cfba014c3c522bdb5c99f.tar.gz |
BUG: Fix refcount leak in f2py `complex_double_from_pyobj`
Diffstat (limited to 'numpy/f2py/cfuncs.py')
-rw-r--r-- | numpy/f2py/cfuncs.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py index 40496ccf1..974062f26 100644 --- a/numpy/f2py/cfuncs.py +++ b/numpy/f2py/cfuncs.py @@ -1023,6 +1023,7 @@ complex_double_from_pyobj(complex_double* v, PyObject *obj, const char *errmess) } (*v).r = ((npy_cdouble *)PyArray_DATA(arr))->real; (*v).i = ((npy_cdouble *)PyArray_DATA(arr))->imag; + Py_DECREF(arr); return 1; } /* Python does not provide PyNumber_Complex function :-( */ |