Integrate pull request feedback

Use while instead of for with additional variable where appropriate.
This commit is contained in:
Bernhard Miklautz 2015-06-25 10:33:54 +02:00
parent 9f6fa7ef4c
commit 28e63786cd
2 changed files with 5 additions and 6 deletions

View File

@ -107,9 +107,8 @@ static BOOL update_message_BitmapUpdate(rdpContext* context, BITMAP_UPDATE* bitm
wParam->rectangles[index].bitmapDataStream = (BYTE*) malloc(wParam->rectangles[index].bitmapLength);
if (!wParam->rectangles[index].bitmapDataStream)
{
UINT32 i;
for (i = 0; i < index; ++i)
free(wParam->rectangles[i].bitmapDataStream);
while(index)
free(wParam->rectangles[--index].bitmapDataStream);
free(wParam->rectangles);
free(wParam);

View File

@ -755,9 +755,9 @@ rdpSettings* freerdp_settings_clone(rdpSettings* settings)
_settings->TargetNetAddresses[index] = _strdup(settings->TargetNetAddresses[index]);
if (!_settings->TargetNetAddresses[index])
{
UINT32 i;
for (i = 0; i < index; ++i)
free(_settings->TargetNetAddresses[i]);
while(index)
free(_settings->TargetNetAddresses[--index]);
free(_settings->TargetNetAddresses);
_settings->TargetNetAddresses = NULL;
_settings->TargetNetAddressCount = 0;