Skip to content

Commit 097810c

Browse files
committed
Merge branch 'jk/test-delete-gpgsig-leakfix' into next
Leakfix. * jk/test-delete-gpgsig-leakfix: test-tool: fix leak in delete-gpgsig command
2 parents b743410 + 85333aa commit 097810c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

t/helper/test-delete-gpgsig.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ int cmd__delete_gpgsig(int argc, const char **argv)
2323
if (!strcmp(pattern, "trailer")) {
2424
size_t payload_size = parse_signed_buffer(buf.buf, buf.len);
2525
fwrite(buf.buf, 1, payload_size, stdout);
26-
fflush(stdout);
27-
return 0;
26+
goto out;
2827
}
2928

3029
bufptr = buf.buf;
@@ -56,7 +55,9 @@ int cmd__delete_gpgsig(int argc, const char **argv)
5655
fwrite(bufptr, 1, (eol - bufptr) + 1, stdout);
5756
bufptr = eol + 1;
5857
}
59-
fflush(stdout);
6058

59+
out:
60+
fflush(stdout);
61+
strbuf_release(&buf);
6162
return 0;
6263
}

0 commit comments

Comments
 (0)