From 1c91ebd435222b533a0c0686d46765eeeb06744e Mon Sep 17 00:00:00 2001 From: "jijoong.moon" Date: Mon, 1 Apr 2019 17:07:40 +0900 Subject: [PATCH] [SVACE/414949] Fix 65505047 Warning Line 448 of unittest_common.cpp has svace warning: WID:65505047 Return value of a function 'fopen64' is dereferenced at unittest_common.cpp:448 without checking, but it is usually checked for this function (8/9). **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon --- tests/common/unittest_common.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/common/unittest_common.cpp b/tests/common/unittest_common.cpp index ee655f7..6e6b9bb 100644 --- a/tests/common/unittest_common.cpp +++ b/tests/common/unittest_common.cpp @@ -445,7 +445,12 @@ static gchar *create_null_file (const gchar *dir, const gchar *file) gchar *fullpath = g_build_path ("/", dir, file, NULL); FILE *fp = g_fopen (fullpath, "w"); - fclose (fp); + if (fp) { + fclose (fp); + } else { + g_free (fullpath); + return NULL; + } return fullpath; } -- 2.7.4