Commit Diff


commit - c31666ae2d9d83148e3a726b077fb0756d807a4d
commit + 9a1d7435894d96f76306bd47db368d52bc7096d3
blob - ad57666926b9f1cab97352254661551bba93066c
blob + 1d279e38f6b3a34d9467747735abf31682c3c3af
--- tog/tog.c
+++ tog/tog.c
@@ -3839,11 +3839,6 @@ open_diff_view(struct tog_view *view, struct got_objec
 		s->id1 = got_object_id_dup(id1);
 		if (s->id1 == NULL)
 			return got_error_from_errno("got_object_id_dup");
-		s->f1 = got_opentemp();
-		if (s->f1 == NULL) {
-			err = got_error_from_errno("got_opentemp");
-			goto done;
-		}
 	} else
 		s->id1 = NULL;
 
@@ -3853,6 +3848,12 @@ open_diff_view(struct tog_view *view, struct got_objec
 		goto done;
 	}
 
+	s->f1 = got_opentemp();
+	if (s->f1 == NULL) {
+		err = got_error_from_errno("got_opentemp");
+		goto done;
+	}
+
 	s->f2 = got_opentemp();
 	if (s->f2 == NULL) {
 		err = got_error_from_errno("got_opentemp");