Skip to content

Commit 824d5f8

Browse files
committed
Fix segfault in test_bad_target_closed_connection
1 parent 7943561 commit 824d5f8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Modules/_sqlite/connection.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,10 @@ pysqlite_connection_backup(pysqlite_Connection *self, PyObject *args, PyObject *
14721472
return NULL;
14731473
}
14741474

1475+
if (!pysqlite_check_connection((pysqlite_Connection *)target)) {
1476+
return NULL;
1477+
}
1478+
14751479
if ((pysqlite_Connection *)target == self) {
14761480
PyErr_SetString(PyExc_ValueError, "target cannot be the same connection instance");
14771481
return NULL;
@@ -1486,10 +1490,6 @@ pysqlite_connection_backup(pysqlite_Connection *self, PyObject *args, PyObject *
14861490
}
14871491
#endif
14881492

1489-
if (!pysqlite_check_connection((pysqlite_Connection *)target)) {
1490-
return NULL;
1491-
}
1492-
14931493
if (progress != Py_None && !PyCallable_Check(progress)) {
14941494
PyErr_SetString(PyExc_TypeError, "progress argument must be a callable");
14951495
return NULL;

0 commit comments

Comments
 (0)