@@ -96,11 +96,11 @@ handle->next->previous = handle->previous; if (firstHandle == handle) firstHandle = handle->next; - free(handle); + of_free(handle); } OF_DESTRUCTOR() { for (of_file_handle_t iter = firstHandle; iter != NULL; @@ -241,14 +241,11 @@ @throw [OFOpenItemFailedException exceptionWithPath: path mode: mode errNo: errno]; #else - if ((handle = malloc(sizeof(*handle))) == NULL) - @throw [OFOutOfMemoryException - exceptionWithRequestedSize: sizeof(*handle)]; - + handle = of_malloc(1, sizeof(*handle)); @try { if ((flags = parseMode(mode.UTF8String, &handle->append)) == -1) @throw [OFInvalidArgumentException exception]; @@ -306,11 +303,11 @@ if (firstHandle != NULL) firstHandle->previous = handle; firstHandle = handle; } @catch (id e) { - free(handle); + of_free(handle); @throw e; } #endif objc_autoreleasePoolPop(pool);