Merge branch 'jk/misc-fixes-maint'
authorJunio C Hamano <gitster@pobox.com>
Mon, 28 Jul 2014 18:30:41 +0000 (11:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Jul 2014 18:30:41 +0000 (11:30 -0700)
* jk/misc-fixes-maint:
apply: avoid possible bogus pointer
fix memory leak parsing core.commentchar
transport: fix leaks in refs_from_alternate_cb
free ref string returned by dwim_ref
receive-pack: don't copy "dir" parameter

1  2 
builtin/apply.c
builtin/receive-pack.c
builtin/rev-parse.c
builtin/show-branch.c
config.c
sha1_name.c
transport.c
diff --cc builtin/apply.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc config.c
index 9767c4bad0d0ae4af58a5f1e7f14d124d1174e10,40799a1dbaa1a156a5d2693e1e17eb85d52e3a0e..058505cb8d8d8bb531527b620125b0204732458a
+++ b/config.c
@@@ -817,17 -824,10 +817,15 @@@ static int git_default_core_config(cons
                return git_config_string(&editor_program, var, value);
  
        if (!strcmp(var, "core.commentchar")) {
-               const char *comment;
-               int ret = git_config_string(&comment, var, value);
-               if (ret)
-                       return ret;
-               else if (!strcasecmp(comment, "auto"))
+               if (!value)
+                       return config_error_nonbool(var);
 -              else
++              else if (!strcasecmp(value, "auto"))
 +                      auto_comment_line_char = 1;
-               else if (comment[0] && !comment[1]) {
-                       comment_line_char = comment[0];
++              else if (value[0] && !value[1]) {
+                       comment_line_char = value[0];
 +                      auto_comment_line_char = 0;
 +              } else
 +                      return error("core.commentChar should only be one character");
                return 0;
        }
  
diff --cc sha1_name.c
Simple merge
diff --cc transport.c
Simple merge