]> git.sesse.net Git - vlc/commitdiff
xdg: fix infinite loop if the file is invalid
authorRémi Duraffort <ivoire@videolan.org>
Tue, 31 Dec 2013 17:38:38 +0000 (18:38 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 2 Jan 2014 08:15:37 +0000 (09:15 +0100)
src/posix/dirs.c

index 10b5ac42665c0e09fa57a8dde98b998dbd41c44c..5e43394e72e2f6ddc15f1ef2800c6379ce24b22e 100644 (file)
@@ -181,11 +181,12 @@ static char *config_GetTypeDir (const char *xdg_name)
                 {
                     free (path);
                     path = NULL;
-                    continue;
+                    break;
                 }
                 *(out++) = *(ptr++);
             }
-            *out = '\0';
+            if (path != NULL)
+                *out = '\0';
             break;
         }
         free (linebuf);