Commit Diff


commit - f1028607764f02c97ecb72a8d85a6bbf1bbe5b58
commit + 56275f3b8784d02cc619785d1926615cb54fd059
blob - 658c27563232e250780c4d2b9306e9643b58167f
blob + c2ccdab78896af45f70d3c4742e99cb041535eac
--- lib/diff.c
+++ lib/diff.c
@@ -118,11 +118,9 @@ get_diffstat(struct got_diffstat_cb_arg *ds, const cha
 	err = got_pathlist_insert(&pe, ds->paths, path, change);
 	if (err || pe == NULL) {
 		free(change);
-		if (err)
-			return err;
+		return err;
 	}
 
-	pe = RB_MAX(got_pathlist_head, ds->paths);
 	diffstat_field_width(&ds->max_path_len, &ds->add_cols, &ds->rm_cols,
 	    pe->path_len, change->add, change->rm);