 		}
 
 		var mergeDiff: OpaquePointer? = nil
+		defer { git_object_free(mergeDiff) }
 		for parent in commit.parents {
 			let error = self.diff(from: parent.oid, to: commit.oid) { (diff: Result<OpaquePointer, NSError>) -> NSError? in
 				guard diff.error == nil else {

			}

			oldTree = result.value
			git_object_free(oldTree)
		}

		var newTree: OpaquePointer? = nil
		if let oid = newCommitOid {
			let result = unsafeTreeForCommitId(oid)
			guard result.error == nil else {

			}

			newTree = result.value
		}

		var diff: OpaquePointer? = nil
