[vlc-commits] darwin/dirs: Fix memory leak in error case

Marvin Scholz git at videolan.org
Tue Mar 20 15:21:57 CET 2018


vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Mar 20 14:23:16 2018 +0100| [4e2f1bf6065f9c86a36e8dcdc11f8f40345177c0] | committer: Hugo Beauzée-Luyssen

darwin/dirs: Fix memory leak in error case

(cherry picked from commit 9b345dac14e3c3ba90f01bf366d6dbf4514f5bc6)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4e2f1bf6065f9c86a36e8dcdc11f8f40345177c0
---

 src/darwin/dirs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/darwin/dirs.c b/src/darwin/dirs.c
index c80a59d5b5..d0489fd21c 100644
--- a/src/darwin/dirs.c
+++ b/src/darwin/dirs.c
@@ -152,6 +152,8 @@ static char *getAppDependentDir(vlc_userdir_t type)
                 Boolean ret = CFStringGetCString(identifierAsNS, identifier, size, kCFStringEncodingUTF8);
                 if (ret)
                     name = identifier;
+                else
+                    free(identifier);
             }
         }
     }



More information about the vlc-commits mailing list