[cups.development] [cups.commit] [CUPS] r5850 -in branches/kerberos: . cups

Jelmer Vernooij jelmer at samba.org
Mon Aug 21 18:18:35 PDT 2006


On Mon, 2006-08-21 at 20:57 -0400, Michael Sweet wrote:
> Jelmer Vernooij wrote:
> > On Mon, 2006-08-21 at 15:24 -0400, Michael Sweet wrote:
> >>  > ...
> >>> Modified: branches/kerberos/cups/auth.c
> >>> ===================================================================
> >>> --- branches/kerberos/cups/auth.c	2006-08-21 01:27:12 UTC (rev 5849)
> >>> +++ branches/kerberos/cups/auth.c	2006-08-21 01:44:37 UTC (rev 5850)
> >>> @@ -160,7 +160,9 @@
> >>>    * Clear the current authentication string...
> >>>    */
> >>>  
> >>> -  http->authstring[0] = '\0';
> >>> +  http->_authstring[0] = '\0';
> >>> +  free(http->authstring);
> >>> +  http->authstring = NULL;
> >>>  
> >>>   /*
> >>>    * See if we can do local authentication...
> >> Careful now, will http->authstring always be non-NULL?  free(NULL) is
> >> undefined on some systems...
> > It will actually be NULL in some cases. Which systems have problems with
> > free'ing NULL? C89 defines free(NULL) as valid and I haven't ever
> > encountered a system which has problems with it (at least not on any
> > systems Samba runs on, though it's probably less portable than cups).
> IIRC, Solaris up to v2.6, IRIX until 6.5, HPUX 10.x, Tru64 UNIX 4.x,
> and AIX 4.x all had problems with free(NULL)...  Also, various
> replacement malloc implementations don't necessarily follow C89... :(
Ah, that explains why we're not running Samba on any of those in the
buildfarm (-: I'll add if()'s before the free() calls. Maybe we could
add some wrapper macro to take care of that?

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.cups.org/pipermail/cups-devel/attachments/20060821/4012a26b/attachment.sig>


More information about the cups-devel mailing list