bugreport-service uses the default crash_root_path when there is no config file 49/255949/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 25 Mar 2021 10:13:42 +0000 (11:13 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 25 Mar 2021 10:29:26 +0000 (11:29 +0100)
Change-Id: If5d6b0b0323576a27e115a407c3130a2bac2111f

src/bugreport-service/diagnostics/diagnostics.c

index defee17..ebce15f 100644 (file)
@@ -379,10 +379,13 @@ int diagnostics_report_get_file(const char *report_path,
        assert(report_path);
 
        config_t config;
-       if (!config_init(&config, CRASH_MANAGER_CONFIG_PATH))
-               return -BR_ERR_INTERNAL;
+       char *crash_root_path = NULL;
+       if (config_init(&config, CRASH_MANAGER_CONFIG_PATH))
+               crash_root_path = config.crash_root_path;
+       else
+               crash_root_path = CRASH_ROOT_PATH;
 
-       bool is_report = is_report_file(report_path, config.crash_root_path);
+       bool is_report = is_report_file(report_path, crash_root_path);
        config_free(&config);
 
        if (!is_report) {