Fix a few memory leaks

Detected by Cppcheck

Signed-off-by: Boris Egorov <egorov@linux.com>
Fix two more memory leaks

Taken from a Cppcheck report provided by Boris Egorov.

https://bugzilla.gnome.org/show_bug.cgi?id=740348