mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
fix double free in SpringBoardAccess
This commit is contained in:
parent
3d7d58e9fa
commit
8ce585cf3e
@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (usage) {
|
if (usage) {
|
||||||
printf("Usage: %s add/remove StatuBarImageName", argv[0]);
|
printf("Usage: %s add/remove StatuBarImageName\n", argv[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,15 +28,13 @@ _ ## class ## $ ## name(self, sel, ## args)
|
|||||||
|
|
||||||
|
|
||||||
CFDataRef myCallBack(CFMessagePortRef local, SInt32 msgid, CFDataRef cfData, void *info) {
|
CFDataRef myCallBack(CFMessagePortRef local, SInt32 msgid, CFDataRef cfData, void *info) {
|
||||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
|
||||||
|
|
||||||
UIApplication *theApp = [UIApplication sharedApplication];
|
UIApplication *theApp = [UIApplication sharedApplication];
|
||||||
|
|
||||||
const char *data = (const char *) CFDataGetBytePtr(cfData);
|
const char *data = (const char *) CFDataGetBytePtr(cfData);
|
||||||
UInt16 dataLen = CFDataGetLength(cfData);
|
UInt16 dataLen = CFDataGetLength(cfData);
|
||||||
|
|
||||||
if (dataLen > 1 && data) {
|
if (dataLen > 1 && data) {
|
||||||
NSString * name = [[NSString stringWithCString:&data[1] encoding:NSASCIIStringEncoding] autorelease];
|
NSString * name = [NSString stringWithCString:&data[1] encoding:NSASCIIStringEncoding];
|
||||||
switch (data[0]){
|
switch (data[0]){
|
||||||
case SBAC_addStatusBarImage:
|
case SBAC_addStatusBarImage:
|
||||||
[theApp addStatusBarImageNamed:name];
|
[theApp addStatusBarImageNamed:name];
|
||||||
@ -48,7 +46,6 @@ CFDataRef myCallBack(CFMessagePortRef local, SInt32 msgid, CFDataRef cfData, voi
|
|||||||
NSLog(@"Unknown command %u, len %u", data[0], dataLen);
|
NSLog(@"Unknown command %u, len %u", data[0], dataLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[pool release];
|
|
||||||
return NULL; // as stated in header, both data and returnData will be released for us after callback returns
|
return NULL; // as stated in header, both data and returnData will be released for us after callback returns
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
TODO.txt
2
TODO.txt
@ -1,7 +1,7 @@
|
|||||||
/* new todo file for BTstack */
|
/* new todo file for BTstack */
|
||||||
|
|
||||||
Last milestone reached: create script to build APT package for BTdeamon, Resources, and BTstack client library
|
Last milestone reached: create script to build APT package for BTdeamon, Resources, and BTstack client library
|
||||||
Last change: clean up command names and headers
|
Last change: fix doulbe free in SpringBoardAccess
|
||||||
|
|
||||||
|
|
||||||
NEXT:
|
NEXT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user