Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'.
  • Loading branch information
carlosmn committed Mar 26, 2014
commit 4c3c706cb9e4ae2cb8934a876c85f70cff20b431
4 changes: 2 additions & 2 deletions src/repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down