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

Michael Knabe t3 at aafhh.de
Tue Oct 26 12:30:22 CEST 2010


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


More information about the TYPO3-team-commerce mailing list