From 574cd9566e6e9ecd29c1e435d4636d406aa57017 Mon Sep 17 00:00:00 2001 From: Alexander Strange Date: Fri, 10 Sep 2004 20:25:50 +0000 Subject: [PATCH] fix malloc leak --- ITAppleEventTools.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.20.1