(shell_exec) use pclose for FILE* that has been opened via popen!

@- Fixed zombie problem in shell_exec() and $a = `some_command`
@  constructs. (Thies)
This commit is contained in:
Thies C. Arntzen 1999-10-13 14:01:47 +00:00
parent 6e07d060fc
commit e6ffafa264

View File

@ -398,7 +398,7 @@ PHP_FUNCTION(shell_exec)
allocated_space = total_readbytes+EXEC_INPUT_BUF;
return_value->value.str.val = (char *) erealloc(return_value->value.str.val,allocated_space);
}
fclose(in);
pclose(in);
return_value->value.str.val = erealloc(return_value->value.str.val,total_readbytes+1);
return_value->value.str.val[total_readbytes]=0;