summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_sqlite/connection.c')
-rw-r--r--Modules/_sqlite/connection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index da2f12e..94c38ad 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -165,6 +165,10 @@ pysqlite_connection_init_impl(pysqlite_Connection *self,
(uri ? SQLITE_OPEN_URI : 0), NULL);
Py_END_ALLOW_THREADS
+ if (self->db == NULL && rc == SQLITE_NOMEM) {
+ PyErr_NoMemory();
+ return -1;
+ }
if (rc != SQLITE_OK) {
_pysqlite_seterror(state, self->db);
return -1;