chiark / gitweb /
sd-device: fix return codes on error
[elogind.git] / src / libsystemd / sd-device / device-enumerator.c
index d59da7d88f380e7f6776fe15cfa204e5001416b7..1d79aff8b454008dadca66ec0cbb5ac9223d1e74 100644 (file)
@@ -771,9 +771,9 @@ static int parent_crawl_children(sd_device_enumerator *enumerator, const char *p
                 if (dent->d_type != DT_DIR)
                         continue;
 
-                k = asprintf(&child, "%s/%s", path, dent->d_name);
-                if (k < 0)
-                        return -errno;
+                child = strjoin(path, "/", dent->d_name, NULL);
+                if (!child)
+                        return -ENOMEM;
 
                 k = parent_add_child(enumerator, child);
                 if (k < 0)