[Spice-devel] [PATCH 6/9] common: spice_memdup could accept NULL

Christophe Fergeau cfergeau at redhat.com
Wed Apr 27 05:06:48 PDT 2011


On Wed, Apr 27, 2011 at 07:27:18AM -0400, Marc-André Lureau wrote:
> Sigh.. i would prefer to avoid ASSERT, and instead use return_val_if_fail() or so.
> 
> That's probably why I didn't add it in the first place.

The old code would crash anyway when being passed NULL, that's why I
suggested a hard ASSERT here, to crash at the same place instead of getting
different failures that might be harder to diagnose later on. A
g_return_val_if_fail might work, but there is no such thing in spice/ :)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110427/0dd5ea5e/attachment.pgp>


More information about the Spice-devel mailing list