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

Christophe Fergeau cfergeau at redhat.com
Wed Apr 27 06:26:49 PDT 2011


On Wed, Apr 27, 2011 at 02:06:48PM +0200, Christophe Fergeau wrote:
> 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/ :)

Thinking some more about it, if the patch wasn't written as a fix for a
crash when spice_memdup was passed NULL, I'm ok with ack'ing the 1st
version too.

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/aea9e449/attachment.pgp>


More information about the Spice-devel mailing list