Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
5d085ee8
Commit
5d085ee8
authored
Oct 29, 2008
by
ivoire
Browse files
Use asprintf and check for the return value. (better than malloc+sprintf)
parent
a1d4c652
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libvlc.c
View file @
5d085ee8
...
...
@@ -883,10 +883,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
*
psz_parser
=
'\0'
;
psz_parser
++
;
}
psz_temp
=
(
char
*
)
malloc
(
strlen
(
psz_module
)
+
sizeof
(
",none"
)
);
if
(
psz_temp
)
if
(
asprintf
(
&
psz_temp
,
"%s,none"
,
psz_module
)
!=
-
1
)
{
sprintf
(
psz_temp
,
"%s,none"
,
psz_module
);
libvlc_InternalAddIntf
(
p_libvlc
,
psz_temp
);
free
(
psz_temp
);
}
...
...
src/misc/variables.c
View file @
5d085ee8
...
...
@@ -1577,9 +1577,9 @@ int __var_Command( vlc_object_t *p_this, const char *psz_name,
if
(
psz_msg
)
{
*
psz_msg
=
(
char
*
)
malloc
(
80
);
sprintf
(
*
psz_msg
,
"%s on object %s returned %i (%s)"
,
psz_cmd
,
psz_name
,
i_ret
,
vlc_error
(
i_ret
)
)
;
if
(
asprintf
(
psz_msg
,
"%s on object %s returned %i (%s)"
,
psz_cmd
,
psz_name
,
i_ret
,
vlc_error
(
i_ret
)
)
==
-
1
)
*
psz_msg
=
NULL
;
}
return
i_ret
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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