Skip to content

Commit 5bbfd38

Browse files
committed
Check for errors in float adaptation
1 parent 6cece00 commit 5bbfd38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

psycopg/typecast_basic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typecast_FLOAT_cast(const char *s, Py_ssize_t len, PyObject *curs)
6565
PyObject *str = NULL, *flo = NULL;
6666

6767
if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
68-
str = Text_FromUTF8AndSize(s, len);
68+
if (!(str = Text_FromUTF8AndSize(s, len))) { return NULL; }
6969
#if PY_MAJOR_VERSION < 3
7070
flo = PyFloat_FromString(str, NULL);
7171
#else

0 commit comments

Comments
 (0)