According to the fundamental lemma of calculus of variations, if $$ \int\limits_a^b f(x)h(x) dx = 0 $$ for an arbitrary $h(x)$, then $f(x) = 0$, for $x$ in $[a, b]$. Of course, accompanied by the usual assumptions.
Now, for the case where $$ f_1(b)h(b) + \int\limits_a^b f_2(x)h(x) dx = 0 $$ again for an arbitrary $h(x)$, can we say anything similar about $f_1(b)$ and $f_2(x)$, for $x$ in $[a, b]$?
My version of the "fundamental lemma of calculus of variation" (e.g. from Gelfand and Fomin's book) is the following:
Therefore, if you assume likewise that $f_2$ is continuous, then the condition of the lemmas is satisfied (because you can assume $h(b)=0$), so $f_2(x)=0$ for all $x\in[a,b]$. If your assumption is $h$ is any continuous function (without restricting $h(a)=h(b)=0$), then you can also deduce that $f_1(b)=0$.