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

Alexandre Janniaux ajanni at videolabs.io
Fri Apr 2 08:00:32 UTC 2021


Hi,

LGTM, but can you update the $NetBSD comment right above the
function to match the one from the NetBSD file?

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


More information about the vlc-devel mailing list