[vlc-devel] [PATCH v2 2/2] compat: update tdelete from upstream NetBSD

Steve Lhomme robux4 at ycbcr.xyz
Fri Apr 2 08:28:32 UTC 2021


On 2021-04-02 10:00, Alexandre Janniaux wrote:
> Hi,
> 
> LGTM, but can you update the $NetBSD comment right above the
> function to match the one from the NetBSD file?

I can

/*	$NetBSD: tdelete.c,v 1.8 2016/01/20 20:47:41 christos Exp $	*/

> Regards,
> --
> Alexandre Janniaux
> Videolabs
> 
> On Fri, Apr 02, 2021 at 09:12:32AM +0200, Steve Lhomme wrote:
>> As found in http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/tdelete.c?rev=1.8&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
>> Or https://github.com/NetBSD/src/blob/trunk/lib/libc/stdlib/tdelete.c
>>
>> Our tfind, tsearch and twalk are already similar to upstream. For some reason,
>> tdestroy is not there as a single file anymore.
>>
>> Fixes some leaks solved on 2016-01-20.
>> ---
>>   compat/tfind.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/compat/tfind.c b/compat/tfind.c
>> index 03382f2aea5..a6110ecf00b 100644
>> --- a/compat/tfind.c
>> +++ b/compat/tfind.c
>> @@ -67,8 +67,7 @@ tdelete(const void* vkey, void** vrootp, int (*compar)(const void*, const void*)
>>   			q->rlink = (*rootp)->rlink;
>>   		}
>>   	}
>> -	if (p != *rootp)
>> -		free(*rootp);			/* D4: Free node */
>> +	free(*rootp);				/* D4: Free node */
>>   	*rootp = q;				/* link parent to new node */
>>   	return p;
>>   }
>> --
>> 2.29.2
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list