[MPlayer-cvslog] r37753 - trunk/libmenu/menu_console.c
reimar
subversion at mplayerhq.hu
Sat Feb 20 12:11:17 CET 2016
Author: reimar
Date: Sat Feb 20 12:11:16 2016
New Revision: 37753
Log:
Check for dup() failure.
Fixes Coverity warning.
Modified:
trunk/libmenu/menu_console.c
Modified: trunk/libmenu/menu_console.c
==============================================================================
--- trunk/libmenu/menu_console.c Sat Feb 20 12:11:15 2016 (r37752)
+++ trunk/libmenu/menu_console.c Sat Feb 20 12:11:16 2016 (r37753)
@@ -315,8 +315,13 @@ static int run_shell_cmd(menu_t* menu, c
return 0;
}
if(!mpriv->child) { // Chlid process
+ FILE *errf;
int err_fd = dup(2);
- FILE* errf = fdopen(err_fd,"w");
+ if (err_fd == -1) {
+ fprintf(stderr,"dup failed : %s\n",strerror(errno));
+ exit(1);
+ }
+ errf = fdopen(err_fd,"w");
// Bind the std fd to our pipes
dup2(in[0],0);
dup2(out[1],1);
More information about the MPlayer-cvslog
mailing list