backup = g_strdup_printf("%s.%d", file_path, rev);
+ if (!backup)
+ return;
+
if (access(backup, F_OK) == 0)
report_manager_update_file_revision(rev, file_path);
char *backup = NULL;
backup = g_strdup_printf("%s.%d", LOG_FILE_PATH, rev);
+ if (!backup)
+ return;
if (access(backup, F_OK) == 0)
__netconfig_log_update_file_revision(rev);
struct stat attr;
gchar *full_path = g_strdup_printf("%s/%s", path, dir->d_name);
+ if (!full_path)
+ continue;
+
if (stat(full_path, &attr)== 0) {
if(lastModified > attr.st_mtime)
{
gchar *path;
path = g_strdup_printf("%s/%s", pathname, filename);
+ if (!path) {
+ ERR("Failed to allocate memory");
+ return ret;
+ }
+
if (g_file_test(path, G_FILE_TEST_EXISTS) == FALSE) {
ret = TRUE;
} else if (g_file_test(path, G_FILE_TEST_IS_REGULAR) == TRUE) {
}
dir = g_strdup_printf(CONNMAN_STORAGE "/%s", group_name);
+ if (!dir) {
+ ERR("Failed to allocate memory");
+ g_free(group_name);
+ return FALSE;
+ }
+
if (g_file_test(dir, G_FILE_TEST_IS_DIR) == TRUE) {
if (__remove_configuration(dir) != TRUE) {
ERR("[%s] is existed, but cannot remove", dir);