diff --git a/source/libublsettings.c b/source/libublsettings.c index 0d95d2d..5ec7727 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -2582,10 +2582,11 @@ int yon_file_create_full_path(char *path, int rules){ mkdir(temp,0755); } else { FILE *fl = fopen(temp,"w"); - int chmod_success = chmod(temp,rules); + fclose(fl); } - struct passwd *user = getpwnam(yon_ubl_root_user_get()); - int chown_success = chown(temp,user->pw_uid,user->pw_gid); + struct passwd *user = getpwnam(yon_ubl_root_user_get()); + int chown_success = chown(temp,user->pw_uid,user->pw_gid); + int chmod_success = chmod(temp,rules); } } if (!yon_char_is_empty(current)) free(current);