From: Junio C Hamano Date: Wed, 26 Apr 2017 06:39:10 +0000 (+0900) Subject: Merge branch 'sf/putty-w-args' X-Git-Tag: v2.13.0-rc1~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d4592d73ef2a4a9cdef528cbd40c3b7660c64b5b?hp=-c Merge branch 'sf/putty-w-args' Plug a memleak. * sf/putty-w-args: connect.c: fix leak in handle_ssh_variant --- d4592d73ef2a4a9cdef528cbd40c3b7660c64b5b diff --combined connect.c index 568a35f754,380997afdd..cd21a1b6f7 --- a/connect.c +++ 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; @@@ -153,7 -153,7 +153,7 @@@ 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; } @@@ -169,7 -169,7 +169,7 @@@ } 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") ||