jcs
/amend
/amendments
/199
repo: Plug memory leak in alloc failure
jcs made amendment 199 18 days ago
--- repo.c Sun Oct 4 12:24:52 2026
+++ repo.c Sun Oct 4 12:33:36 2026
@@ -490,6 +490,8 @@ repo_show_diff_text(struct repo *repo, struct repo_ame
dtext = xmalloc(all_len, M_CANFAIL);
if (dtext == NULL) {
warn("Failed allocating %ld bytes for diff", all_len);
+ xfree(&buf);
+ xfree(&bob);
return;
}
memcpy(dtext, buf, header_len);