Commit 91bef24e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

libvlc: call exit() if command line help was requested

A library should not call exit(), but I do not see any easy way around
it: if libvlc_new() returns NULL on error so real errors cannot be
distinguished from --help stuff. Also --daemon already calls exit()
(through daemon()).

This introduces an O(1) memory leak when calling --help. It could be
fixed by merging libvlc_InternalCreate() and libvlc_InternalInit().
parent 0c40a30a
...@@ -224,7 +224,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -224,7 +224,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if (config_PrintHelp (VLC_OBJECT(p_libvlc))) if (config_PrintHelp (VLC_OBJECT(p_libvlc)))
{ {
module_EndBank (true); module_EndBank (true);
return VLC_EEXITSUCCESS; exit(0);
} }
if( module_count <= 1 ) if( module_count <= 1 )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment