summaryrefslogtreecommitdiff
path: root/numpy/f2py/src/fortranobject.c
diff options
context:
space:
mode:
authorChris Kerr <cjk34@cam.ac.uk>2014-09-04 20:09:19 +0100
committerChris Kerr <cjk34@cam.ac.uk>2014-09-04 20:09:19 +0100
commit00a33398b35541cf347fe76f844ee64be9e1d37b (patch)
tree5c6cf43cc0573528c98b35acf4503b63f66ce806 /numpy/f2py/src/fortranobject.c
parent596dd845b9c451c443c0e9f7a64c7932b205d1ca (diff)
downloadnumpy-00a33398b35541cf347fe76f844ee64be9e1d37b.tar.gz
Changed the `goto fail` to a `return PyErr_NoMemory()`
Diffstat (limited to 'numpy/f2py/src/fortranobject.c')
-rw-r--r--numpy/f2py/src/fortranobject.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c
index efdf4a725..0e23c4c37 100644
--- a/numpy/f2py/src/fortranobject.c
+++ b/numpy/f2py/src/fortranobject.c
@@ -125,7 +125,10 @@ fortran_doc (FortranDataDef def) {
if (def.doc!=NULL)
size += strlen(def.doc);
p = (char*)malloc (size);
- if (p==NULL) goto fail;
+ if (p==NULL) {
+ /* No need to call free() because p is NULL */
+ return PyErr_NoMemory();
+ }
p[0] = '\0'; /* make sure that the buffer has zero length */
if (def.rank==-1) {
if (def.doc==NULL) {