From: Mike Bayer Date: Fri, 22 May 2020 14:13:02 +0000 (-0400) Subject: Don't incref on new reference key_style X-Git-Tag: rel_1_4_0b1~319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5910f9ca3fba4b639861617b09dd7b0cfa8d3fa9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- diff --git a/lib/sqlalchemy/cextension/resultproxy.c b/lib/sqlalchemy/cextension/resultproxy.c index 244379116d..8511d4223d 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;