core: coverity issue fix.

Change-Id: Icf39bb13920df91e9707f861ea7c345cddd79902
Signed-off-by: Martin Mucha <mmucha@redhat.com>