Commit Diff


commit - 9c6e101af4e6750c4464b294980d7852903c8817
commit + c2f16475fd622a4c9490402b7918f9991c407aa1
blob - 445f746a04884c06491e5f23e9c151ee40b29eef
blob + d84bf2d52afb7651dc297c34a9614a0f7c90e71f
--- tog/tog.c
+++ tog/tog.c
@@ -416,10 +416,23 @@ queue_commits(struct got_commit_graph *graph, struct c
 					err = NULL;
 					changed = 1;
 				} else {
-					changed = (got_object_id_cmp(
-					    got_object_get_id(obj),
-					    got_object_get_id(pobj)) != 0);
+					struct got_object_id *id, *pid;
+					id = got_object_get_id(obj);
+					if (id == NULL) {
+						err = got_error_from_errno();
+						break;
+					}
+					pid = got_object_get_id(pobj);
+					if (pid == NULL) {
+						err = got_error_from_errno();
+						free(id);
+						break;
+					}
+					changed =
+					    (got_object_id_cmp(id, pid) != 0);
 					got_object_close(pobj);
+					free(id);
+					free(pid);
 				}
 			}
 			if (!changed) {