[vlc-commits] config_Get*Dir() : don't call FromLocaleDup(NULL)

Rafaël Carré git at videolan.org
Tue Aug 30 14:54:33 CEST 2011


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Tue Aug 30 08:52:49 2011 -0400| [077b53f13b4c3c79021da5dedc05c0deb6712ce8] | committer: Rafaël Carré

config_Get*Dir() : don't call FromLocaleDup(NULL)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=077b53f13b4c3c79021da5dedc05c0deb6712ce8
---

 src/posix/dirs.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/posix/dirs.c b/src/posix/dirs.c
index 955fc8e..d3468ff 100644
--- a/src/posix/dirs.c
+++ b/src/posix/dirs.c
@@ -82,6 +82,9 @@ static char *config_GetHomeDir (void)
     }
 #endif
 
+    if (!home)
+        return NULL
+
     return FromLocaleDup (home);
 }
 
@@ -204,7 +207,7 @@ static char *config_GetTypeDir (const char *xdg_name)
         if (strcmp (xdg_name, "DESKTOP") == 0)
         {
             if (asprintf (&path, "%s/Desktop", home) == -1)
-                path = NULL;
+                return NULL;
         }
         else
             path = strdup (home);



More information about the vlc-commits mailing list