@@ -411,6 +411,7 @@ void FunkeyMenu::init_menu_system_values(){
411411 volume_percentage = 50 ; // /wrong value: setting default to 50
412412 }
413413 else {
414+ pclose (fp);
414415 fgets (res, sizeof (res)-1 , fp);
415416
416417 // / Check if Volume is a number (at least the first char)
@@ -431,6 +432,7 @@ void FunkeyMenu::init_menu_system_values(){
431432 brightness_percentage = 50 ; // /wrong value: setting default to 50
432433 }
433434 else {
435+ pclose (fp);
434436 fgets (res, sizeof (res)-1 , fp);
435437
436438 // / Check if brightness is a number (at least the first char)
@@ -828,6 +830,8 @@ int FunkeyMenu::launch( )
828830 fp = popen (shell_cmd, " r" );
829831 if (fp == NULL ) {
830832 MENU_ERROR_PRINTF (" Failed to run command %s\n " , shell_cmd);
833+ } else {
834+ pclose (fp);
831835 }
832836
833837 // / ------ Refresh screen ------
@@ -844,6 +848,8 @@ int FunkeyMenu::launch( )
844848 fp = popen (shell_cmd, " r" );
845849 if (fp == NULL ) {
846850 MENU_ERROR_PRINTF (" Failed to run command %s\n " , shell_cmd);
851+ } else {
852+ pclose (fp);
847853 }
848854 // / ------ Refresh screen ------
849855 screen_refresh = 1 ;
@@ -889,6 +895,8 @@ int FunkeyMenu::launch( )
889895 fp = popen (shell_cmd, " r" );
890896 if (fp == NULL ) {
891897 MENU_ERROR_PRINTF (" Failed to run command %s\n " , shell_cmd);
898+ } else {
899+ pclose (fp);
892900 }
893901 // / ------ Refresh screen ------
894902 screen_refresh = 1 ;
@@ -904,6 +912,8 @@ int FunkeyMenu::launch( )
904912 fp = popen (shell_cmd, " r" );
905913 if (fp == NULL ) {
906914 MENU_ERROR_PRINTF (" Failed to run command %s\n " , shell_cmd);
915+ } else {
916+ pclose (fp);
907917 }
908918 // / ------ Refresh screen ------
909919 screen_refresh = 1 ;
@@ -982,6 +992,7 @@ int FunkeyMenu::launch( )
982992 MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
983993 }
984994 else{
995+ pclose(fp);
985996 usb_sharing = !usb_sharing;
986997 }*/
987998
@@ -1053,6 +1064,8 @@ int FunkeyMenu::launch( )
10531064 fp = popen (shell_cmd, " r" );
10541065 if (fp == NULL ) {
10551066 MENU_ERROR_PRINTF (" Failed to run command %s\n " , shell_cmd);
1067+ } else {
1068+ pclose (fp);
10561069 }
10571070
10581071 return MENU_RETURN_EXIT;
0 commit comments