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

Michael Sweet mike at easysw.com
Mon Aug 21 17:57:27 PDT 2006


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... :(

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com




More information about the cups mailing list