Use smart pointers instead of handling with new/delete. Fixes: Resource leak (RESOURCE_LEAK) leaked_storage: Variable rev going out of scope leaks the storage it points to. Change-Id: I33dfe6c4a74a01774093dc500248c3ed613b5710