chiark / gitweb /
coverity: fix a couple of bugs found by coverity
[elogind.git] / src / util.c
index 6033aa05b271b4f55f361d31d576ba13c979de76..6a9fffbf3df88e9531bee37390987b7a29f07e44 100644 (file)
@@ -5529,6 +5529,9 @@ int get_files_in_directory(const char *path, char ***list) {
          * number */
 
         d = opendir(path);
+        if (!d)
+                return -errno;
+
         for (;;) {
                 struct dirent buffer, *de;
                 int k;
@@ -5629,6 +5632,8 @@ char *join(const char *x, ...) {
 
                         p = stpcpy(p, t);
                 }
+
+                va_end(ap);
         } else
                 r[0] = 0;