From badb7f435d6c83340bc2d6c8575399aef87dea1b Mon Sep 17 00:00:00 2001 From: richo Date: Sat, 5 Jan 2013 02:20:40 +1100 Subject: [PATCH] Always decref the new string. Don't set err. --- src/pygit2/repository.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/pygit2/repository.c b/src/pygit2/repository.c index bc0a2b8..f5f31d3 100644 --- a/src/pygit2/repository.c +++ b/src/pygit2/repository.c @@ -168,12 +168,8 @@ Repository_build_as_iter(git_oid *oid, PyObject *accum) PyObject *oid_str = git_oid_to_py_str(oid); err = PyList_Append(accum, oid_str); - if (err < 0) { - Error_set(err); - return -1; - } - Py_XDECREF(oid_str); - return 0; + Py_DECREF(oid_str); + return err; } PyObject *