Potential leak of memory pointed to by 'machine'

NSString * zipPath=[ NSString stringWithFormat : @"{TIME=%@" ,[ self getChuo_time ]]; size_t size;
   
sysctlbyname ( "hw.machine" , NULL , &size, NULL , 0 );
   
char *machine = ( char *) malloc (size);
   
sysctlbyname ( "hw.machine" , machine, &size, NULL , 0 );
   
NSString *platform = [ NSString stringWithCString :machine encoding : NSUTF8StringEncoding ]; // 手机型号     free(machine);


malloc  和  free是必须配对儿使用的。要不就是内存泄漏




更多推荐

Potential leak of memory pointed to by 'machine'