This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch hotfix/coverity_fix
in repository https://gitbox.apache.org/repos/asf/celix.git

commit 180bd1d3ad63ceee91716a6aee4be9079b01ad71
Author: PengZheng <[email protected]>
AuthorDate: Mon Apr 10 14:18:08 2023 +0800

    Eliminate false positive coverity warning (CID=313586).
---
 libs/utils/src/celix_file_utils.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libs/utils/src/celix_file_utils.c 
b/libs/utils/src/celix_file_utils.c
index dcfd6b70..f8bb12fc 100644
--- a/libs/utils/src/celix_file_utils.c
+++ b/libs/utils/src/celix_file_utils.c
@@ -129,10 +129,11 @@ celix_status_t celix_utils_createDirectory(const char* 
path, bool failIfPresent,
         if (*p == '/') {
             /* Temporarily truncate */
             *p = '\0';
-            if (maybe_mkdir(_path, S_IRWXU) != 0) {
+            result = maybe_mkdir(_path, S_IRWXU);
+            *p = '/';
+            if (result != 0) {
                 goto out;
             }
-            *p = '/';
         }
     }
     if (maybe_mkdir(_path, S_IRWXU) != 0) {

Reply via email to