summaryrefslogtreecommitdiffstats
path: root/rbutil/ipodpatcher/ipodio-posix.c
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-12-19 21:21:28 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-12-19 21:21:28 +0000
commit084d57cef4dfdac8fa122ee4da8b15996aacdc2b (patch)
treee7bda3a20c713fb846e174f648eca175e9cc6603 /rbutil/ipodpatcher/ipodio-posix.c
parentee3fc61a48975c90b72cc4089b4f0e47495c1345 (diff)
downloadrockbox-084d57cef4dfdac8fa122ee4da8b15996aacdc2b.tar.gz
rockbox-084d57cef4dfdac8fa122ee4da8b15996aacdc2b.tar.bz2
rockbox-084d57cef4dfdac8fa122ee4da8b15996aacdc2b.zip
Check if creating the dictionary worked before accessing it, not afterwards.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28860 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/ipodpatcher/ipodio-posix.c')
-rw-r--r--rbutil/ipodpatcher/ipodio-posix.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/rbutil/ipodpatcher/ipodio-posix.c b/rbutil/ipodpatcher/ipodio-posix.c
index 881c09b54f..db8648e70e 100644
--- a/rbutil/ipodpatcher/ipodio-posix.c
+++ b/rbutil/ipodpatcher/ipodio-posix.c
@@ -167,13 +167,12 @@ int ipod_scsi_inquiry(struct ipod_t* ipod, int page_code,
/* set value to match. In case of the Ipod this is "iPodUserClientDevice". */
CFMutableDictionaryRef sub_dict;
sub_dict = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL);
+ if(sub_dict == NULL)
+ return -1;
CFDictionarySetValue(sub_dict, CFSTR(kIOPropertySCSITaskDeviceCategory),
CFSTR("iPodUserClientDevice"));
CFDictionarySetValue(match_dict, CFSTR(kIOPropertyMatchKey), sub_dict);
- if(sub_dict == NULL)
- return -1;
-
/* get an iterator for searching for the service. */
kern_return_t kr;
io_iterator_t iterator = IO_OBJECT_NULL;