Fix SVACE warnings 211740, 216811 66/314066/3 accepted/tizen/unified/20240805.060250 accepted/tizen/unified/dev/20240807.092956 accepted/tizen/unified/toolchain/20240812.132727 accepted/tizen/unified/x/20240806.012746 accepted/tizen/unified/x/asan/20240813.231016
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Thu, 4 Jul 2024 14:17:25 +0000 (16:17 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Fri, 5 Jul 2024 11:35:28 +0000 (13:35 +0200)
Change-Id: I2b18fe5bf6a17329a0aea1f9f304611c508ba2ce

src/crash-manager/crash-manager.c
src/crash-stack/mem_map.c

index e12e5b83a86cf8d925329def8a4a9da1096ec7b2..6bcb150e9f9f0df7af2ceafacc963202403e337b 100644 (file)
@@ -1248,7 +1248,7 @@ static void release_crashed_process()
        _I("Released crashed process lock");
 }
 
-static bool run(struct crash_info *cinfo)
+static void run(struct crash_info *cinfo)
 {
        /* Special PID ( <= 0) for which the report will contain only
         * dump_systemstate output
@@ -1331,8 +1331,6 @@ static bool run(struct crash_info *cinfo)
                        kill_pid(cinfo->pid_info, SIGKILL, false);
                }
        }
-
-       return true;
 }
 
 static bool crash_manager_prepare(struct crash_info *cinfo)
@@ -1402,10 +1400,10 @@ EXPORT bool crash_manager_direct(struct crash_info *cinfo)
        if (!crash_manager_prepare(cinfo))
                return false;
 
-       bool result = run(cinfo);
+       run(cinfo);
        crash_manager_cleanup(cinfo);
 
-       return result;
+       return true;
 }
 
 EXPORT bool crash_manager_livedump_pid(pid_t pid, const char *dump_reason, char *report_path, size_t report_path_len)
@@ -1422,12 +1420,9 @@ EXPORT bool crash_manager_livedump_pid(pid_t pid, const char *dump_reason, char
 
        write_dump_reason(dump_reason, cinfo.pfx, cinfo.name);
 
-       result = run(&cinfo);
+       run(&cinfo);
        crash_manager_cleanup(&cinfo);
 
-       if (!result)
-               goto exit;
-
        strncpy(report_path, cinfo.result_path, report_path_len);
 
        result = true;
index bc60f73467e5f5a6ae2d29ee8dcaa538f831706a..105f8f074d2f7aea6fe01a5d8979cf80e5732d24 100644 (file)
@@ -389,6 +389,10 @@ static int mem_region_map_file(struct mem_region *region)
 static int mem_region_init_vdso(struct mem_region *region)
 {
     region->data_head = malloc(sizeof(struct mem_data_chunk));
+    if (region->data_head == NULL) {
+        _E("Memory allocation error");
+        return -1;
+    }
     mem_data_chunk_init(region->data_head);
     region->data_head->start = region->start;
     region->data_head->length = region->length;