Whitehead's lemma (Lie algebras) is: Let $\mathfrak{g}$ be a semisimple Lie algebra over a field of characteristic zero, $V$ a finite-dimensional module over it and $f$: $\mathfrak{g} \to V$ a linear map such that $f([x, y]) = xf(y) - yf(x)$. The lemma states that there exists a vector $v$ in $V$ such that $f(x) = xv$ for all $x$.
If we let $\mathfrak{g}$ be a reductive Lie algebra (for example, let $\mathfrak{g} = \mathfrak{gl}_n$), the conclusion of Whitehead's lemma is still true or not (or we need to add some other conditions)? Are there some references about this? Any help will be greatly appreciated!