kmsutils: fix memory leak

Change-Id: Ic1324e3e8fb02a72f2356e72847b6206ebd36d62