Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
4e2aec4c
Commit
4e2aec4c
authored
Dec 28, 2014
by
David
Browse files
auhal: fix memleak, check malloc return value
parent
21cefda1
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/audio_output/auhal.c
View file @
4e2aec4c
...
...
@@ -1265,8 +1265,13 @@ static void RebuildDeviceList(audio_output_t * p_aout)
}
length
=
CFStringGetLength
(
device_name_ref
);
length
++
;
psz_name
=
(
char
*
)
malloc
(
length
);
psz_name
=
malloc
(
length
);
if
(
!
psz_name
)
{
CFRelease
(
device_name_ref
);
return
;
}
CFStringGetCString
(
device_name_ref
,
psz_name
,
length
,
kCFStringEncodingUTF8
);
CFRelease
(
device_name_ref
);
msg_Dbg
(
p_aout
,
"DevID: %i DevName: %s"
,
deviceIDs
[
i
],
psz_name
);
...
...
@@ -1296,7 +1301,6 @@ static void RebuildDeviceList(audio_output_t * p_aout)
// TODO: only register once for each device
ManageAudioStreamsCallback
(
p_aout
,
deviceIDs
[
i
],
true
);
CFRelease
(
device_name_ref
);
free
(
psz_name
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment