Merge branch 'sf/putty-w-args'
authorJunio C Hamano <gitster@pobox.com>
Wed, 26 Apr 2017 06:39:10 +0000 (15:39 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Apr 2017 06:39:10 +0000 (15:39 +0900)
Plug a memleak.

* sf/putty-w-args:
connect.c: fix leak in handle_ssh_variant

1  2 
connect.c
diff --combined connect.c
index 568a35f754e41d54dc0e7133bbfaa0d1d02ccb27,380997afdd479b4d52d4639198a7d181f72e3226..cd21a1b6f725fc80e40759a8f9b26450633df6a8
+++ b/connect.c
@@@ -111,8 -111,8 +111,8 @@@ static void annotate_refs_with_symref_i
   */
  struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
                              struct ref **list, unsigned int flags,
 -                            struct sha1_array *extra_have,
 -                            struct sha1_array *shallow_points)
 +                            struct oid_array *extra_have,
 +                            struct oid_array *shallow_points)
  {
        struct ref **orig_list = list;
  
                                die("protocol error: expected shallow sha-1, got '%s'", arg);
                        if (!shallow_points)
                                die("repository on the other end cannot be shallow");
 -                      sha1_array_append(shallow_points, old_oid.hash);
 +                      oid_array_append(shallow_points, &old_oid);
                        continue;
                }
  
                }
  
                if (extra_have && !strcmp(name, ".have")) {
 -                      sha1_array_append(extra_have, old_oid.hash);
 +                      oid_array_append(extra_have, &old_oid);
                        continue;
                }
  
@@@ -738,8 -738,10 +738,10 @@@ static void handle_ssh_variant(const ch
                         * any longer.
                         */
                        free(ssh_argv);
-               } else
+               } else {
+                       free(p);
                        return;
+               }
        }
  
        if (!strcasecmp(variant, "plink") ||