From 82b564d080d1e178736b18ea0e0d8bf8de3a00a8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 19 Apr 2024 12:02:05 +0600 Subject: [PATCH] Zombie processes fix --- source/libublsettings.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/libublsettings.c b/source/libublsettings.c index 747ccfb..43791ff 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -781,6 +781,7 @@ char *yon_ubl_root_user_get(){ memset(user,0,4096); fgets(user,4096,file); user=yon_char_divide_search(user,"\n",-1); + fclose(file); if (user) return user; } } @@ -793,6 +794,7 @@ char *yon_ubl_user_get_home_directory(){ memset(ret,0,4096); fgets(ret,4096,path); ret=yon_char_divide_search(ret,"\n",-1); + fclose(path); return ret; } @@ -1492,6 +1494,8 @@ config_str yon_config_load(char *command, int *str_len){ i++; } } + if (output) + fclose(output); if (i>0){ *str_len = i; return output_strings; @@ -1740,6 +1744,7 @@ char *yon_config_save_simple(YON_CONFIG_TYPE target, char *path){ return final_string; } } + fclose(file); } } return NULL;