Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e53ca14

Browse files
authored
Merge pull request #13287 from cgohlke/patch-1
Fix unsafe use of NULL pointer
2 parents c52ffa3 + bdb5500 commit e53ca14

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/file_compat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ static NPY_INLINE FILE *mpl_PyFile_Dup(PyObject *file, char *mode, mpl_off_t *or
9595
#endif
9696
if (handle == NULL) {
9797
PyErr_SetString(PyExc_IOError, "Getting a FILE* from a Python file object failed");
98+
return NULL;
9899
}
99100

100101
/* Record the original raw file handle position */

0 commit comments

Comments
 (0)