@@ -114,16 +114,17 @@ @interface OFHTTPServerThread: OFThread - (void)stop; @end #endif -static OF_INLINE OFString * +static OFString * normalizedKey(OFString *key) { char *cString = OFStrDup(key.UTF8String); unsigned char *tmp = (unsigned char *)cString; bool firstLetter = true; + OFString *ret; while (*tmp != '\0') { if (!OFASCIIIsAlpha(*tmp)) { firstLetter = true; tmp++; @@ -136,16 +137,18 @@ firstLetter = false; tmp++; } @try { - return [OFString stringWithUTF8StringNoCopy: cString - freeWhenDone: true]; + ret = [OFString stringWithUTF8StringNoCopy: cString + freeWhenDone: true]; } @catch (id e) { OFFreeMemory(cString); @throw e; } + + return ret; } @implementation OFHTTPServerResponse - (instancetype)initWithSocket: (OFStreamSocket *)sock server: (OFHTTPServer *)server