On a class of Leibniz algebras