Re: [PATCH 09/23] builtin/remote: fix leaking strings in `branch_list`

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

 



On Fri, Jul 26, 2024 at 02:15:36PM +0200, Patrick Steinhardt wrote:
> @@ -292,8 +292,8 @@ static int config_read_branches(const char *key, const char *value,
>  		type = PUSH_REMOTE;
>  	else
>  		return 0;
> -	name = xmemdupz(key, key_len);
>
> +	name = xmemdupz(key, key_len);

I stared at this for longer than I'd like to admit wondering if there
was a whitespace error in the pre-image or something. But I see you just
moved initializing 'name' next to the initialization of 'item'.

I'd argue that might be a stray diff, but I don't think it matters much.

>  	item = string_list_insert(&branch_list, name);
>
>  	if (!item->util)
> @@ -337,6 +337,7 @@ static int config_read_branches(const char *key, const char *value,
>  		BUG("unexpected type=%d", type);
>  	}
>
> +	free(name);
>  	return 0;
>  }

The patch looks good to me otherwise.

Thanks,
Taylor




[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