sapi_add_header_ex() violating CODING_STANDARDS
| From: | js | Date: | Tue, 03 Apr 2007 13:43:29 +0000 |
| Subject: | sapi_add_header_ex() violating CODING_STANDARDS | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-251983@lists.php.net to get a copy of this message | ||
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?