Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e3895ba9
Commit
e3895ba9
authored
Jan 26, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codec_cmml: fix memleaks (and maybe a proble while opening browser under linux).
parent
8c4225ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
15 deletions
+28
-15
modules/codec/cmml/browser_open.c
modules/codec/cmml/browser_open.c
+28
-15
No files found.
modules/codec/cmml/browser_open.c
View file @
e3895ba9
...
@@ -28,29 +28,38 @@
...
@@ -28,29 +28,38 @@
# include "config.h"
# include "config.h"
#endif
#endif
#include "xstrcat.h"
#include <stdio.h>
#include <stdlib.h>
#include "browser_open.h"
#include "browser_open.h"
int
browser_Open
(
const
char
*
psz_url
)
int
browser_Open
(
const
char
*
psz_url
)
{
{
#ifdef __APPLE__
#ifdef __APPLE__
char
*
psz_open_commandline
;
char
*
psz_open_commandline
;
int
i_ret
;
psz_open_commandline
=
strdup
(
"/usr/bin/open "
);
if
(
asprintf
(
&
psz_open_commandline
,
"/usr/bin/open %s"
,
psz_url
)
==
-
1
)
psz_open_commandline
=
xstrcat
(
psz_open_commandline
,
psz_url
)
;
return
-
1
;
return
system
(
psz_open_commandline
);
i_ret
=
system
(
psz_open_commandline
);
free
(
psz_open_commandline
);
return
i_ret
;
#elif defined( UNDER_CE )
#elif defined( UNDER_CE )
return
-
1
;
return
-
1
;
#elif defined( WIN32 )
#elif defined( WIN32 )
char
*
psz_open_commandline
;
char
*
psz_open_commandline
;
int
i_ret
;
psz_open_commandline
=
strdup
(
"explorer "
);
if
(
asprintf
(
&
psz_open_commandline
,
"explorer %s"
,
psz_url
)
==
-
1
)
xstrcat
(
psz_open_commandline
,
psz_url
)
;
return
-
1
;
return
system
(
psz_open_commandline
);
i_ret
=
system
(
psz_open_commandline
);
free
(
psz_open_commandline
);
return
i_ret
;
#else
#else
/* Assume we're on a UNIX of some sort */
/* Assume we're on a UNIX of some sort */
...
@@ -58,18 +67,22 @@ int browser_Open( const char *psz_url )
...
@@ -58,18 +67,22 @@ int browser_Open( const char *psz_url )
int
i_ret
;
int
i_ret
;
/* Debian uses www-browser */
/* Debian uses www-browser */
psz_open_commandline
=
strdup
(
"www-browser"
);
if
(
asprintf
(
&
psz_open_commandline
,
"www-browser %s"
,
psz_url
)
==
-
1
)
xstrcat
(
psz_open_commandline
,
psz_url
);
return
-
1
;
i_ret
=
system
(
psz_open_commandline
);
if
(
i_ret
==
0
)
return
0
;
i_ret
=
system
(
psz_open_commandline
);
free
(
psz_open_commandline
);
free
(
psz_open_commandline
);
if
(
i_ret
==
0
)
return
0
;
/* Try mozilla */
/* Try mozilla */
psz_open_commandline
=
strdup
(
"mozilla"
);
if
(
asprintf
(
&
psz_open_commandline
,
"mozilla %s"
,
psz_url
)
==
-
1
)
xstrcat
(
psz_open_commandline
,
psz_url
);
return
-
1
;
return
system
(
psz_open_commandline
);
i_ret
=
system
(
psz_open_commandline
);
free
(
psz_open_commandline
);
return
i_ret
;
#endif
#endif
}
}
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