commit a33a44db81f52e0217b4e38e2e180442521f37ad from: Omar Polo date: Sat Sep 03 09:43:03 2022 UTC gotwebd: got_output_file_blame: free lines on error path ok stsp@ commit - 8a4f92ca904ede1f7a5e7e1bafdf8be7974943ed commit + a33a44db81f52e0217b4e38e2e180442521f37ad blob - 76c6d44ac38e69c04070e891dd9273426ebc3fc3 blob + 7ffadf4bd520c4bcb95709f980fb217d68e7f98c --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -1296,7 +1296,8 @@ got_output_file_blame(struct request *c) GOT_DIFF_ALGORITHM_MYERS, got_gotweb_blame_cb, &bca, NULL, NULL, fd3, fd4, f1, f2); - if (blob) { +done: + if (bca.lines) { free(bca.line_offsets); for (i = 0; i < bca.nlines; i++) { struct blame_line *bline = &bca.lines[i]; @@ -1304,7 +1305,6 @@ got_output_file_blame(struct request *c) free(bline->committer); } } -done: free(bca.lines); if (fd2 != -1 && close(fd2) == -1 && error == NULL) error = got_error_from_errno("close");