Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -161,11 +161,16 @@ [super free]; @throw [OFInvalidEncodingException newWithClass: c]; } - string = [self getMemWithSize: length + 1]; + @try { + string = [self getMemWithSize: length + 1]; + } @catch (OFException *e) { + [self free]; + @throw e; + } memcpy(string, str, length + 1); } } return self;