//\r
if (CurrentSize != NULL) {\r
NewSize = *CurrentSize;\r
- while (NewSize < (DestinationStartSize + (Count*sizeof(CHAR16)))) {\r
- NewSize += 2 * Count * sizeof(CHAR16);\r
+ if (NewSize < DestinationStartSize + (Count * sizeof(CHAR16))) {\r
+ while (NewSize < (DestinationStartSize + (Count*sizeof(CHAR16)))) {\r
+ NewSize += 2 * Count * sizeof(CHAR16);\r
+ }\r
+ *Destination = ReallocatePool(*CurrentSize, NewSize, *Destination);\r
+ *CurrentSize = NewSize;\r
}\r
- *Destination = ReallocatePool(*CurrentSize, NewSize, *Destination);\r
- *CurrentSize = NewSize;\r
} else {\r
*Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));\r
}\r