Skip to content

Commit f4f78e6

Browse files
committed
Merge branch 'maint'
* maint: diff.c: plug a memory leak in an error path fetch-pack: close output channel after sideband demultiplexer terminates builtin-remote: Make "remote show" display all urls
2 parents 8513c54 + 802f9c9 commit f4f78e6

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

builtin-fetch-pack.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,9 @@ static int sideband_demux(int fd, void *data)
483483
{
484484
int *xd = data;
485485

486-
return recv_sideband("fetch-pack", xd[0], fd);
486+
int ret = recv_sideband("fetch-pack", xd[0], fd);
487+
close(fd);
488+
return ret;
487489
}
488490

489491
static int get_pack(int xd[2], char **pack_lockfile)

builtin-remote.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,9 +1005,12 @@ static int show(int argc, const char **argv)
10051005

10061006
get_remote_ref_states(*argv, &states, query_flag);
10071007

1008-
printf("* remote %s\n URL: %s\n", *argv,
1009-
states.remote->url_nr > 0 ?
1010-
states.remote->url[0] : "(no URL)");
1008+
printf("* remote %s\n", *argv);
1009+
if (states.remote->url_nr) {
1010+
for (i=0; i < states.remote->url_nr; i++)
1011+
printf(" URL: %s\n", states.remote->url[i]);
1012+
} else
1013+
printf(" URL: %s\n", "(no URL)");
10111014
if (no_query)
10121015
printf(" HEAD branch: (not queried)\n");
10131016
else if (!states.heads.nr)

diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3596,6 +3596,7 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
35963596
if (start_command(&child) != 0 ||
35973597
strbuf_read(&buf, child.out, 0) < 0 ||
35983598
finish_command(&child) != 0) {
3599+
strbuf_release(&buf);
35993600
remove_tempfile();
36003601
error("error running textconv command '%s'", pgm);
36013602
return NULL;

0 commit comments

Comments
 (0)