Skip to content

Commit c71b7a0

Browse files
committed
Added missing return in case out of memory.
1 parent 1ed16c8 commit c71b7a0

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
@@ -125,7 +125,7 @@ typecast_DECIMAL_cast(char *s, Py_ssize_t len, PyObject *curs)
125125
if (s == NULL) {Py_INCREF(Py_None); return Py_None;}
126126

127127
if ((buffer = PyMem_Malloc(len+1)) == NULL)
128-
PyErr_NoMemory();
128+
return PyErr_NoMemory();
129129
strncpy(buffer, s, (size_t) len); buffer[len] = '\0';
130130
res = PyObject_CallFunction(decimalType, "s", buffer);
131131
PyMem_Free(buffer);

0 commit comments

Comments
 (0)