[vlc-devel] [PATCH 1/1] codec/dirac: Rewrite libdirac(-research) encoding support

Laurent Aimar fenrir at via.ecp.fr
Tue Nov 11 15:17:56 CET 2008

On Mon, Nov 10, 2008, David Flynn wrote:
> >  psz_tmp may be NULL in case of allocation failure.`
> Pointless allocation failure checks be damned.
> I've just gone and deleted all the validation of psz_tmp sice it was
> pointed out it returned "", i'm a little peeved at having to put them
> all back.
 Well, it is the current policy, that new codes do not segfault on
allocation failure so ... 
 Using var_GetNonEmptyString may be the easiest way in your code, it will either
return NULL or a non empty string. It will merge the NULL and "" case in one.
(You can just handle allocation failures as a case where no value is provided)


More information about the vlc-devel mailing list