diff options
| author | Sebastian Berg <sebastian@sipsolutions.net> | 2019-01-20 18:17:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-20 18:17:42 +0100 |
| commit | 2b05f3e38431842ff06df9b2958d22c5a0588767 (patch) | |
| tree | 822e10a0e360a3d90bb9c5de73f3a280b4a7954a /numpy/core/src | |
| parent | 99953e494aa3be5ae8385d8461b9e4dfbeec43ec (diff) | |
| parent | adfaafba9f45cea66a344d0d67916bee38b79ce2 (diff) | |
| download | numpy-2b05f3e38431842ff06df9b2958d22c5a0588767.tar.gz | |
Merge pull request #12805 from mattip/double-decref
BUG: double decref of dtype in failure codepath. Test and fix
Diffstat (limited to 'numpy/core/src')
| -rw-r--r-- | numpy/core/src/multiarray/ctors.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index 63bf5377a..b2e329d45 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -2500,6 +2500,11 @@ PyArray_FromInterface(PyObject *origin) &PyArray_Type, dtype, n, dims, NULL, data, dataflags, NULL, base); + /* + * Ref to dtype was stolen by PyArray_NewFromDescrAndBase + * Prevent DECREFing dtype in fail codepath by setting to NULL + */ + dtype = NULL; if (ret == NULL) { goto fail; } |
