mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.13] gh-129346: Handle allocation errors for SQLite aggregate context (GH-129347) (#129372)
(cherry picked from commit 379ab856f5
)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
parent
d7d4edfa75
commit
247c3b2644
2 changed files with 7 additions and 0 deletions
|
@ -958,6 +958,11 @@ step_callback(sqlite3_context *context, int argc, sqlite3_value **params)
|
|||
assert(ctx != NULL);
|
||||
|
||||
aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
|
||||
if (aggregate_instance == NULL) {
|
||||
(void)PyErr_NoMemory();
|
||||
set_sqlite_error(context, "unable to allocate SQLite aggregate context");
|
||||
goto error;
|
||||
}
|
||||
if (*aggregate_instance == NULL) {
|
||||
*aggregate_instance = PyObject_CallNoArgs(ctx->callable);
|
||||
if (!*aggregate_instance) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue