Fix DEREF_OF_NULL.RET.ALLOC issue 35/319035/1
authorchaehee.hong <chaehee.hong@samsung.com>
Mon, 3 Feb 2025 10:55:35 +0000 (19:55 +0900)
committerchaehee.hong <chaehee.hong@samsung.com>
Mon, 3 Feb 2025 10:55:48 +0000 (19:55 +0900)
Change-Id: Idcadc4a4c16dc37a82078fbf09c1cf950ea584c5

src/inm-util.c

index 544657496ed5418975fb9316c72fb0d9dd3102e8..eebcf726b926dbc59d752c1b59b02bd7c38b5e6c 100644 (file)
@@ -1231,6 +1231,10 @@ static void __make_log_backup(void)
        int res = 0;
 
        backup = g_strdup_printf("%s.%d", LOG_FILE_PATH, rev);
+       if (backup == NULL) {
+               INM_LOGE("Fail to allocate memory");
+               return;
+       }
 
        if (access(backup, F_OK) == 0)
                __update_log_file_revision(rev);