Consider the action function:
$$\mathcal{S}(t)=\int_{t_1}^{t_2}\mathcal{L}(q_i,\dot{q_i},t) dt$$
where $\mathcal{L}$ is the Lagrangian of the system.
The Hamiltonian is defined by the following expression:
$$\mathcal{H(q_i,p_i,t)}=\dot{q_i}p_i-\mathcal{L}(q_i,\dot{q_i},t)$$
So we have,
$$\mathcal{S}(t)=\int_{t_1}^{t_2}\left[\dot{q_i}p_i-\mathcal{H}(q_i,{p_i},t)\right] dt$$
The Hamilton's Priciple says that $\delta\mathcal{S}=0$.
So we have,
$$\delta\mathcal{S}(t)=\int_{t_1}^{t_2}\left[\delta(\dot{q_i}p_i)-\delta\mathcal{H}(q_i,{p_i},t)\right] dt$$
I found on Goldstein 3rd edition that they considered the next step as
$$\delta\mathcal{S}(t)=\int_{t_1}^{t_2}\left(\delta\dot{q_i}p_i+\dot{q_i}\delta p_i- \frac{\partial\mathcal{H}}{\partial q_i}\delta q_i - \frac{\partial\mathcal{H}}{\partial p_i}\delta p_i \right)dt$$
Didn't they miss the $\frac{\partial\mathcal{H}}{\partial t}\delta t$ term resulting from $\delta\mathcal{H}$?
One more question: Is it true that $\frac{d}{dt}(\delta q_i)=\delta \dot{q_i}$?