summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-05-22 10:13:02 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-22 10:19:57 -0400
commit5910f9ca3fba4b639861617b09dd7b0cfa8d3fa9 (patch)
tree4886db6bedd7e5e33128f0abfa7cc98ce551f592
parentd45657a2f5b880dc22dda2d1eb1687af5234a470 (diff)
downloadsqlalchemy-5910f9ca3fba4b639861617b09dd7b0cfa8d3fa9.tar.gz
Don't incref on new reference key_style
in 4550983e0ce2f35b3585e53894c941c23693e71d we added a new attribute key_style. remove an erroneous Py_INCREF when we acquire it from PyLong_FromLong as we already own the reference. since this is a new reference we actualy need to Py_DECREF it because we aren't returning it. Change-Id: I61470513a173c76863ec6f7f5ff9b2ec13582f08
-rw-r--r--lib/sqlalchemy/cextension/resultproxy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/cextension/resultproxy.c b/lib/sqlalchemy/cextension/resultproxy.c
index 244379116..8511d4223 100644
--- a/lib/sqlalchemy/cextension/resultproxy.c
+++ b/lib/sqlalchemy/cextension/resultproxy.c
@@ -241,11 +241,11 @@ BaseRow_filter_on_values(BaseRow *self, PyObject *filters)
row_class = PyObject_GetAttrString(sqlalchemy_engine_row, "Row");
key_style = PyLong_FromLong(self->key_style);
- Py_INCREF(key_style);
new_obj = PyObject_CallFunction(
row_class, "OOOOO", self->parent, filters, self->keymap,
key_style, self->row);
+ Py_DECREF(key_style);
Py_DECREF(row_class);
if (new_obj == NULL) {
return NULL;