• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTask Leaking...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTask Leaking...


  • Subject: NSTask Leaking...
  • From: "Mr. Gecko" <email@hidden>
  • Date: Thu, 29 Jan 2009 12:20:19 -0600

Hello, I'm trying to make my own licenses system and I need MD5 to verify that the key in the file is right and isn't a fake.
what I've got now is a NSTask that runs md5 -s salt+key+salt2 and it works, but I am getting a leak with NSTask...
I would like to find out how to get rid of that leak; here is my code so you can give me pointers or help me find this out.


- (NSString *)md5:(NSString *)MD5 {
NSPipe *outPipe = [NSPipe pipe];

NSTask* theTask = [[NSTask alloc] init];
[theTask setStandardOutput:[outPipe autorelease]];
[theTask setLaunchPath:@"/sbin/md5"];
[theTask setCurrentDirectoryPath:@"~/"];
[theTask setArguments:[[NSArray arrayWithObjects:@"-s", MD5, nil] autorelease]];
[theTask launch];
[theTask waitUntilExit];
NSString *rMD5 = [[[[NSString alloc] initWithData:[[outPipe fileHandleForReading] readDataToEndOfFile] encoding: NSUTF8StringEncoding] componentsSeparatedByString:@" = "] objectAtIndex:1];
[theTask release];

rMD5 = [self replace:@"\n" with:@"" source:rMD5];

return [rMD5 autorelease];
}


Thanks,
Mr. Gecko
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTask Leaking...
      • From: glenn andreas <email@hidden>
    • Re: NSTask Leaking...
      • From: Vitaly Ovchinnikov <email@hidden>
    • Re: NSTask Leaking...
      • From: Nick Zitzmann <email@hidden>
    • Re: NSTask Leaking...
      • From: "Stephen J. Butler" <email@hidden>
    • Re: NSTask Leaking...
      • From: "Mr. Gecko" <email@hidden>
  • Prev by Date: Interface Builder Plugin Dependency
  • Next by Date: Re: NSTask Leaking...
  • Previous by thread: Re: Interface Builder Plugin Dependency
  • Next by thread: Re: NSTask Leaking...
  • Index(es):
    • Date
    • Thread