summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-10-03 11:28:06 +0300
committerGitHub <noreply@github.com>2019-10-03 11:28:06 +0300
commite6db9ba115d93651ba61e25e6ec7cbe4ef627972 (patch)
treefa21e2b83cd67615c9002ba606fdb8dfbdc4dc1e
parenteba0fff3505e7d9a5ded40e0a38dbe9bef0b3e6c (diff)
parent6bf9f56ae6674def038608f3acb2351639001cac (diff)
downloadnumpy-e6db9ba115d93651ba61e25e6ec7cbe4ef627972.tar.gz
Merge pull request #14631 from sethtroisi/free_clean
BUG: always free clean_sep
-rw-r--r--numpy/core/src/multiarray/ctors.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index e6387e3d3..ba5121306 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -3704,6 +3704,8 @@ array_from_text(PyArray_Descr *dtype, npy_intp num, char *sep, size_t *nread,
}
NPY_END_ALLOW_THREADS;
+ free(clean_sep);
+
if (stop_reading_flag == -2) {
if (PyErr_Occurred()) {
/* If an error is already set (unlikely), do not create new one */
@@ -3718,8 +3720,6 @@ array_from_text(PyArray_Descr *dtype, npy_intp num, char *sep, size_t *nread,
}
}
- free(clean_sep);
-
fail:
if (err == 1) {
PyErr_NoMemory();