Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28658 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39400 invoked by uid 1010); 3 Apr 2007 15:27:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 39385 invoked from network); 3 Apr 2007 15:27:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Apr 2007 15:27:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=ebgssth@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ebgssth@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.175 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ebgssth@gmail.com X-Host-Fingerprint: 66.249.92.175 ug-out-1314.google.com Linux 2.4/2.6 Received: from [66.249.92.175] ([66.249.92.175:7494] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/12-17495-14272164 for ; Tue, 03 Apr 2007 11:26:59 -0400 Received: by ug-out-1314.google.com with SMTP id o4so340931uge for ; Tue, 03 Apr 2007 08:26:55 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lMTT7hr5uP647HflSxrqNjRy5rdtR7lzmasxH/E50pEZlFnMt52dPWsVh0OIB8xJlYk1g5vrHMXXoBHQElM7HHZVrVZdJZTaFJzmLfhspKxKJTTFd/lr+2kXreszqNWYArHVrITMuQ8JFVdUxjWj3imqpiPGkcggQ93JV+E8hbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=b3LdFZLND4n07bJzVCQQJCEwa9FQI8cu8ZZY0z4oamGKg4dFl0K71EvRn1orZThRF9kfcwxSCx3TFswx33ihuG+4TW/qi/Q97Pv80yoOCqTMYvHpIIt/kTNHpiVs6K697nOLW+QI4JkdQ0MUSFieCTTOla/baaj4f/UKiKYSgvA= Received: by 10.67.106.3 with SMTP id i3mr720158ugm.1175614014975; Tue, 03 Apr 2007 08:26:54 -0700 (PDT) Received: by 10.66.216.17 with HTTP; Tue, 3 Apr 2007 08:26:54 -0700 (PDT) Message-ID: Date: Wed, 4 Apr 2007 00:26:54 +0900 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Unexpected usage of 'duplicate' flag in sapi_add_header_ex() From: ebgssth@gmail.com ("js ") Hi gurus. Fiddling with PHP extensions I found the following code in 'sapi_add_header_ex()' in SAPI.c if (!duplicate) efree(header_line); which makes me wonder because the other day I read CODING_STANDARD included in PHP src 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* " I felt the rule above is incompatible with how efree and duplicate flag is used in sapi_add_header_ex(). So my question is... Is this intentional? If so, any reason to break the coding standard in this instance? and what does, in this context, 'duplicate' means? Thanks you in advance.