On Tue, Jan 25, 2011 at 07:17:25PM +0100, Marc-André Lureau wrote:
> diff --git a/common/mem.c b/common/mem.c
> index b0a7eb1..4db8a2c 100644
> --- a/common/mem.c
> +++ b/common/mem.c
> @@ -71,6 +71,10 @@ void *spice_memdup(const void *mem, size_t n_bytes)
>  {
>      void *copy;
>  
> +    if (mem == NULL) {
> +        return NULL;
> +    }
> +

I'd rather have an ASSERT(n_bytes == 0) if we do this change so that we
don't allow memdup'ing pointers that are not expected to be NULL.
Do you remember why you needed this? Wasn't it possible to fix the caller
to not pass NULL?

Christophe

Attachment: pgp0o6fU01MyI.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to