Re: [PATCH 08/22] remote: fix leaking tracking refs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick Steinhardt <ps@xxxxxx> writes:

> @@ -1123,6 +1123,7 @@ void free_one_ref(struct ref *ref)
>  		return;
>  	free_one_ref(ref->peer_ref);
>  	free(ref->remote_status);
> +	free(ref->tracking_ref);
>  	free(ref->symref);
>  	free(ref);
>  }
> @@ -2620,8 +2621,10 @@ static int remote_tracking(struct remote *remote, const char *refname,
>  	dst = apply_refspecs(&remote->fetch, refname);
>  	if (!dst)
>  		return -1; /* no tracking ref for refname at remote */
> -	if (refs_read_ref(get_main_ref_store(the_repository), dst, oid))
> +	if (refs_read_ref(get_main_ref_store(the_repository), dst, oid)) {
> +		free(dst);
>  		return -1; /* we know what the tracking ref is but we cannot read it */
> +	}
>  
>  	*dst_refname = dst;
>  	return 0;

Looking good.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux