mac-capture: Don't call CFRelease on null vars

CFRelease is not meant to be used with null variables.  Check the
variables before calling CFRelease.
This commit is contained in:
jp9000
2015-08-03 00:08:03 -07:00
parent ff0c58e963
commit 05eef74891
2 changed files with 10 additions and 4 deletions

View File

@@ -62,8 +62,10 @@ static bool coreaudio_enum_device(enum_device_proc_t proc, void *param,
enum_next = proc(param, cf_name, cf_uid, id);
fail:
CFRelease(cf_name);
CFRelease(cf_uid);
if (cf_name)
CFRelease(cf_name);
if (cf_uid)
CFRelease(cf_uid);
return enum_next;
}