瀏覽代碼

Fixed memory corruption under non-ARC

Pierre-Olivier Latour 11 年之前
父節點
當前提交
7b51023373
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      CGDWebServer/GCDWebServer.m

+ 1 - 1
CGDWebServer/GCDWebServer.m

@@ -239,7 +239,7 @@ NSString* GCDWebServerGetPrimaryIPv4Address() {
   if (store) {
     CFPropertyListRef info = SCDynamicStoreCopyValue(store, CFSTR("State:/Network/Global/IPv4"));
     if (info) {
-      primaryInterface = [[(ARC_BRIDGE NSDictionary*)info objectForKey:@"PrimaryInterface"] UTF8String];
+      primaryInterface = [[NSString stringWithString:[(ARC_BRIDGE NSDictionary*)info objectForKey:@"PrimaryInterface"]] UTF8String];
       CFRelease(info);
     }
     CFRelease(store);