summaryrefslogtreecommitdiff
path: root/hw/xquartz/X11Application.m
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2010-02-10 17:56:30 -0800
committerJeremy Huddleston <jeremyhu@apple.com>2010-02-15 15:03:49 -0800
commit4127e8e5be5c366eb752bbb8d7f0ff5b519e641b (patch)
treed16e5dc7dcaa683aceeca96888bfc1d3f55f812f /hw/xquartz/X11Application.m
parentc686c5cbdc5f35744407af5f9aabbd18cc17714b (diff)
XQuartz: clang static analysis fixes
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw/xquartz/X11Application.m')
-rw-r--r--hw/xquartz/X11Application.m18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index f3c8a307a..3faa1cb84 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -482,7 +482,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
return out;
}
-- (CFPropertyListRef) prefs_get:(NSString *)key {
+- (CFPropertyListRef) prefs_get_copy:(NSString *)key {
CFPropertyListRef value;
value = CFPreferencesCopyAppValue ((CFStringRef) key, app_prefs_domain_cfstr);
@@ -543,7 +543,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
int ret;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL && CFGetTypeID (value) == CFNumberGetTypeID ())
CFNumberGetValue (value, kCFNumberIntType, &ret);
@@ -561,7 +561,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
const char *ret = NULL;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
NSString *s = (NSString *) value;
@@ -578,12 +578,13 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
NSURL *ret = NULL;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
NSString *s = (NSString *) value;
ret = [NSURL URLWithString:s];
+ [ret retain];
}
if (value != NULL) CFRelease (value);
@@ -595,7 +596,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
float ret = def;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL
&& CFGetTypeID (value) == CFNumberGetTypeID ()
@@ -613,7 +614,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
CFPropertyListRef value;
int ret = def;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL) {
if (CFGetTypeID (value) == CFNumberGetTypeID ())
@@ -637,7 +638,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
NSArray *ret = nil;
CFPropertyListRef value;
- value = [self prefs_get:key];
+ value = [self prefs_get_copy:key];
if (value != NULL) {
if (CFGetTypeID (value) == CFArrayGetTypeID ())
@@ -757,7 +758,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
NSURL *url = [self prefs_copy_url:@PREFS_UPDATE_FEED default:nil];
if(url) {
[[SUUpdater sharedUpdater] setFeedURL:url];
- CFRelease(url);
+ [url release];
}
#endif
}
@@ -970,6 +971,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
// [[SUUpdater sharedUpdater] checkForUpdates:X11App];
#endif
+ [pool release];
[NSApp run];
/* not reached */
}