Fix static analysis issue 47/323747/1
authorinkyun.kil <inkyun.kil@samsung.com>
Wed, 7 May 2025 05:26:03 +0000 (14:26 +0900)
committerinkyun.kil <inkyun.kil@samsung.com>
Wed, 7 May 2025 05:26:03 +0000 (14:26 +0900)
Change-Id: Id2f53c58eaeded3c5fc5c4ad7d53ad3bdca5a474
Signed-off-by: inkyun.kil <inkyun.kil@samsung.com>
common/direct.c

index 0b22473e46ee2b06ca8c4e7d35891440cfcc28da..acc8aa750dfafdd4b1fa498e88d01a7ceb694cee 100644 (file)
@@ -72,13 +72,19 @@ static int get_path(uid_t uid, enum layer_attribute_type type,
 static const struct layer* get_user_layer(const char *name)
 {
        const struct layer *ly = NULL;
+       const char *layer_name;
 
        if (!strcmp(name, "system")) {
-               conf_get_layer("user", &ly);
+               layer_name = "user";
        } else if (!strcmp(name, "memory")) {
-               conf_get_layer("user_memory", &ly);
+               layer_name = "user_memory";
+       } else {
+               return NULL;
        }
 
+       if (conf_get_layer(layer_name, &ly) != BUXTON_ERROR_NONE)
+               return NULL;
+
        return ly;
 }