From: Alexander Strange Date: Fri, 10 Sep 2004 20:25:50 +0000 (+0000) Subject: fix malloc leak X-Git-Tag: v1.0~14 X-Git-Url: http://git.ithinksw.org/ITFoundation.git/commitdiff_plain/574cd9566e6e9ecd29c1e435d4636d406aa57017 fix malloc leak --- diff --git a/ITAppleEventTools.m b/ITAppleEventTools.m index fe76e1a..2677636 100755 --- a/ITAppleEventTools.m +++ b/ITAppleEventTools.m @@ -112,7 +112,8 @@ NSAppleEventDescriptor *ITSendAEWithKey(FourCharCode reqKey, FourCharCode evClas unsigned char *chr = (unsigned char *)malloc(4*sizeof(unsigned char)); memcpy(chr, &reqKey, 4); NSString *sendString = [NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('%s'), from:'null'() }", chr]; - const char *usendString = [sendString UTF8String]; + free(chr); + const char *usendString = [sendString UTF8String]; AppleEvent sendEvent, replyEvent; NSAppleEventDescriptor *send, *recv;