authentication: do not leak resources

Change-Id: Ic03a08f1ef136ca7a7b3af6f1102ee3e393e6b7a
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>