@@ -83,11 +83,11 @@ char *retCString; char byte = 0; int state = 0; size_t i = 0; - retCString = of_alloc(length + 1, 1); + retCString = OFAllocMemory(length + 1, 1); while (length--) { char c = *string++; switch (state) { @@ -106,11 +106,11 @@ else if (c >= 'A' && c <= 'F') byte += (c - 'A' + 10) << shift; else if (c >= 'a' && c <= 'f') byte += (c - 'a' + 10) << shift; else { - free(retCString); + OFFreeMemory(retCString); @throw [OFInvalidFormatException exception]; } if (++state == 3) { retCString[i++] = byte; @@ -124,25 +124,25 @@ retCString[i] = '\0'; objc_autoreleasePoolPop(pool); if (state != 0) { - free(retCString); + OFFreeMemory(retCString); @throw [OFInvalidFormatException exception]; } @try { - retCString = of_realloc(retCString, 1, i + 1); + retCString = OFResizeMemory(retCString, 1, i + 1); } @catch (OFOutOfMemoryException *e) { /* We don't care if it fails, as we only made it smaller. */ } @try { return [OFString stringWithUTF8StringNoCopy: retCString length: i freeWhenDone: true]; } @catch (id e) { - free(retCString); + OFFreeMemory(retCString); @throw e; } } @end