Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
5d085ee8
Commit
5d085ee8
authored
Oct 29, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use asprintf and check for the return value. (better than malloc+sprintf)
parent
a1d4c652
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
src/libvlc.c
src/libvlc.c
+1
-3
src/misc/variables.c
src/misc/variables.c
+3
-3
No files found.
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
Markdown
is supported
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