[vlc-devel] [vlc-commits] darwin/dirs: Fix stack-use-after-scope bug

David Fuhrmann david.fuhrmann at gmail.com
Wed Oct 4 08:23:43 CEST 2017


> Am 04.10.2017 um 01:01 schrieb Marvin Scholz <git at videolan.org>:
> 
> vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Wed Oct  4 01:00:56 2017 +0200| [3acf45b1477f989e271dc0d234d5d9256bc0f758] | committer: Marvin Scholz
> 
> darwin/dirs: Fix stack-use-after-scope bug
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3acf45b1477f989e271dc0d234d5d9256bc0f758
> ---
> 
> src/darwin/dirs.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/src/darwin/dirs.c b/src/darwin/dirs.c
> index 32acc4e0dc..f79990d541 100644
> --- a/src/darwin/dirs.c
> +++ b/src/darwin/dirs.c
> @@ -138,24 +138,30 @@ static char *getAppDependentDir(vlc_userdir_t type)
>     }
> 
>     // Default fallback
> -    const char *name = "org.videolan.vlc";
> +    const char *fallback = strdup("org.videolan.vlc“);

Hi Marvin,

Why this here? strdup seems unneeded, and you are leaking that allocated memory.

BR. David



More information about the vlc-devel mailing list