Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Jun 2009 07:29:36 +0000 (00:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Jun 2009 07:29:36 +0000 (00:29 -0700)
* 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

builtin-fetch-pack.c
builtin-remote.c
diff.c
index 6202462216f3b8c3cbe924d4cc002616e69d75ab..629735f54723a3bc3b24f8c91e9a6226ae28d742 100644 (file)
@@ -483,7 +483,9 @@ static int sideband_demux(int fd, void *data)
 {
        int *xd = data;
 
-       return recv_sideband("fetch-pack", xd[0], fd);
+       int ret = recv_sideband("fetch-pack", xd[0], fd);
+       close(fd);
+       return ret;
 }
 
 static int get_pack(int xd[2], char **pack_lockfile)
index f7d66189ccefe903588c7bbf044c2bc909c50b5a..d7ab6b2d5ff872c7872648bae4c97d7e1aa3ebba 100644 (file)
@@ -1005,9 +1005,12 @@ static int show(int argc, const char **argv)
 
                get_remote_ref_states(*argv, &states, query_flag);
 
-               printf("* remote %s\n  URL: %s\n", *argv,
-                       states.remote->url_nr > 0 ?
-                               states.remote->url[0] : "(no URL)");
+               printf("* remote %s\n", *argv);
+               if (states.remote->url_nr) {
+                       for (i=0; i < states.remote->url_nr; i++)
+                               printf("  URL: %s\n", states.remote->url[i]);
+               } else
+                       printf("  URL: %s\n", "(no URL)");
                if (no_query)
                        printf("  HEAD branch: (not queried)\n");
                else if (!states.heads.nr)
diff --git a/diff.c b/diff.c
index 4d0a5b9ae6f2b5d921a2aae2a03e9a7f1616dc4d..43835d756c2c2c7ec579e1c38804fe33a706944f 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3596,6 +3596,7 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
        if (start_command(&child) != 0 ||
            strbuf_read(&buf, child.out, 0) < 0 ||
            finish_command(&child) != 0) {
+               strbuf_release(&buf);
                remove_tempfile();
                error("error running textconv command '%s'", pgm);
                return NULL;