Fix a potential memory leak found with coverity. Fixes: CID#1197129

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>