Coverity fixes. 91/155491/1 accepted/tizen/unified/20171019.145638 submit/tizen/20171019.034316
authorINSUN PYO <insun.pyo@samsung.com>
Fri, 13 Oct 2017 08:44:42 +0000 (08:44 +0000)
committerINSUN PYO <insun.pyo@samsung.com>
Fri, 13 Oct 2017 08:45:13 +0000 (08:45 +0000)
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
Change-Id: I748823213a6b441144c8d4c192150b73cd60dcfc

src/plugins/default/tlm-account-plugin-default.c

index be4c6b2..6207d2a 100755 (executable)
@@ -147,7 +147,11 @@ gboolean delete_sub_files(const gchar* dir)
             continue;
 
         snprintf(file, max_path, "%s/%s", dir, result->d_name);
-        lstat(file, &file_stat);
+        if (-1 == lstat(file, &file_stat)) {
+            DBG("Could not lstat directory/file '%s', error : %s", file, strerror(errno));
+            break;
+        }
+
         if (S_ISDIR(file_stat.st_mode)) {
             if (!delete_sub_files(file)) {
                 break;