Re: [PATCH v2 22/25] string_list_add_refs_by_glob(): add a comment about memory management

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> Since string_list_add_one_ref() adds refname to the string list, but
> the lifetime of refname is limited, it is important that the
> string_list passed to string_list_add_one_ref() has strdup_strings
> set.  Document this fact.
>
> All current callers do the right thing.
[...]
> +/*
> + * The list argument must have strdup_strings set on it.
> + */
>  void string_list_add_refs_by_glob(struct string_list *list, const char *glob)
>  {
>  	if (has_glob_specials(glob)) {

Maybe add an assert() so that this is bulletproof?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]