summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Gohlke <cgohlke@uci.edu>2021-02-23 19:44:59 -0800
committerGitHub <noreply@github.com>2021-02-23 19:44:59 -0800
commit595824252f3d87bc38b4d9b5839eb8fdbf82eaa5 (patch)
treec9ca6aced643cd8f541be5a79ff3c9e65f539905
parent10e43ca5882a22de3ef9082ffce82c65c3261b8f (diff)
downloadnumpy-595824252f3d87bc38b4d9b5839eb8fdbf82eaa5.tar.gz
MAINT: verify pointer against NULL before using it
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index ae3834e15..afa9c12a2 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -1331,10 +1331,10 @@ get_datetime_to_unicode_transfer_function(int aligned,
/* Get an ASCII string data type, adapted to match the UNICODE one */
str_dtype = PyArray_DescrNewFromType(NPY_STRING);
- str_dtype->elsize = dst_dtype->elsize / 4;
if (str_dtype == NULL) {
return NPY_FAIL;
}
+ str_dtype->elsize = dst_dtype->elsize / 4;
/* Get the copy/swap operation to dst */
if (PyArray_GetDTypeCopySwapFn(aligned,