diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2016-12-26 04:12:18 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2016-12-26 04:12:18 +0100 |
commit | ffeb7001ebfaab34613ce604a509dfa1de193b80 (patch) | |
tree | 6a37779866523304dc70841553715adabd451bbb | |
parent | d13521a6ce1f92956dcca2b68e4e703008580c7b (diff) | |
download | psycopg2-named-callproc.tar.gz |
Fixed refcount problems in named callprocnamed-callproc
-rw-r--r-- | psycopg/cursor_type.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 66580ad..baa5b8f 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -1080,6 +1080,7 @@ psyco_curs_callproc(cursorObject *self, PyObject *args) if (!(scpnames[i] = psycopg_escape_identifier( self->conn, cpname, 0))) { + Py_CLEAR(pname); goto exit; } @@ -1131,12 +1132,12 @@ psyco_curs_callproc(cursorObject *self, PyObject *args) self, operation, pvals, self->conn->async, 0)) { /* The dict case is outside DBAPI scope anyway, so simply return None */ if (using_dict) { - Py_INCREF(Py_None); res = Py_None; } else { res = pvals; } + Py_INCREF(res); } exit: |