Re: sapi_add_header_ex() violating CODING_STANDARDS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



js wrote:
> Hi list.
> 
> I don't think this is the right place to talk about this,
> but writing PHP extensions I found that "sapi_add_header_ex()" in SAPI.c
> is violating a law of PHP CODING_STANDARDS, which says
> 
> "[1] Functions that are given pointers to resources should not free them
> *snip*
> Exceptions:
>  - The function's designated behavior is freeing that resource.  E.g.
> efree()
>  - The function is given a boolean argument, that controls whether or not
>    the function may free its arguments (if true - the function must free
> its
>    arguments, if false - it must not)
> *snip*
> "
> 
> Take a look at the source and you'll see the following code
> 
>    if (!duplicate)
>        efree(header_line);
> 
> not so intuitive.
> 
> Is this a bug?

from your explaination above one could infer that it was a transgression with
regard to CS. whether you could consider it a bug would depend on whether the code
in question actually caused problems or not ... the efree() at the point may have been
placed there conscientiously by someone who knew the CS rules and had good reason to
break them in this instance.

for a real answer I would recommend post a friendly question at internals@xxxxxxxxxxxxx
(you might consider replacing the 'a bug' with something less inclined to illicit a
negative response, e.g. 'intentional'?)

> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux