[TYPO3-commerce] RFC: #10433: Ressource leak in tx_commerce_product::get_Articles_by_AttributeArray

Sebastian Fischer sf at marketing-factory.de
Wed Oct 27 09:04:24 CEST 2010


Am 26.10.2010 12:30, schrieb Michael Knabe:
> Am 26.10.2010 09:28, schrieb Sebastian Fischer:
>> -1 by reading
>>
>> - if (($result) && ($GLOBALS['TYPO3_DB']->sql_num_rows($result) > 0)) {
>> - while ($return_data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
>> - $next_array[] = $return_data['uid'];
>> - }
>> - $GLOBALS['TYPO3_DB']->sql_free_result($result);
>> + while ($return_data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
>> + $next_array[] = $return_data['uid'];
>> }
>> + $GLOBALS['TYPO3_DB']->sql_free_result($result);
>>
>> If i didnt missed anything, this will leave a } of the if-condition
>> behind which will lead to an error.
>
> Thanks for the feedback, but the bracket does belong to the while loop.
> The patch looks a bit weird because it reuses the bracket from the
> if-statement to close the while loop and removes the old bracket from
> the while statement as I changed the indentation level.
> I was also wondering in the first place but double tested it using "php -l"
>
> Cheers,
> Michael

Hi Michael,

okay thats realy wierd but anyway +1 by reading from me now.

Thanks for explaining
Sebastian


More information about the TYPO3-team-commerce mailing list