From 4c3c706cb9e4ae2cb8934a876c85f70cff20b431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 26 Mar 2014 12:37:28 +0100 Subject: [PATCH] Repository: don't jump to cleanup unecessarily Until we have successfully borrowed the message, we have not used up any resources, we can skip jumping to 'out' and we can return NULL directly. This also avoid dereferencing an uninitialised 'tmessage'. --- src/repository.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/repository.c b/src/repository.c index 1e654e2..031e6e0 100644 --- a/src/repository.c +++ b/src/repository.c @@ -807,11 +807,11 @@ Repository_create_commit(Repository *self, PyObject *args) len = py_oid_to_git_oid(py_oid, &oid); if (len == 0) - goto out; + return NULL; message = py_str_borrow_c_str(&tmessage, py_message, encoding); if (message == NULL) - goto out; + return NULL; err = git_tree_lookup_prefix(&tree, self->repo, &oid, len); if (err < 0) {