diff options
author | Hameer Abbasi <einstein.edison@gmail.com> | 2019-10-08 02:22:41 +0500 |
---|---|---|
committer | Hameer Abbasi <einstein.edison@gmail.com> | 2019-10-08 02:22:41 +0500 |
commit | 2246f68b1af3f27bce9cbee3a49aa10e1dd7cb80 (patch) | |
tree | 6eaa55f3167512cc044304512be5ac87f215d9ff /numpy/f2py/src/fortranobject.c | |
parent | 750a59e9310ff1226ff2912fc29a815c2ce07ed2 (diff) | |
parent | d2c57616d369fdb5b4ea22b77d314785b1a0508e (diff) | |
download | numpy-2246f68b1af3f27bce9cbee3a49aa10e1dd7cb80.tar.gz |
Merge branch 'uarray' into uarray-me
Diffstat (limited to 'numpy/f2py/src/fortranobject.c')
-rw-r--r-- | numpy/f2py/src/fortranobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c index 4a981bf55..b55385b50 100644 --- a/numpy/f2py/src/fortranobject.c +++ b/numpy/f2py/src/fortranobject.c @@ -80,7 +80,10 @@ PyFortranObject_NewAsAttr(FortranDataDef* defs) { /* used for calling F90 module PyFortranObject *fp = NULL; fp = PyObject_New(PyFortranObject, &PyFortran_Type); if (fp == NULL) return NULL; - if ((fp->dict = PyDict_New())==NULL) return NULL; + if ((fp->dict = PyDict_New())==NULL) { + PyObject_Del(fp); + return NULL; + } fp->len = 1; fp->defs = defs; return (PyObject *)fp; @@ -91,7 +94,7 @@ PyFortranObject_NewAsAttr(FortranDataDef* defs) { /* used for calling F90 module static void fortran_dealloc(PyFortranObject *fp) { Py_XDECREF(fp->dict); - PyMem_Del(fp); + PyObject_Del(fp); } |