Change return value of listKeys

Not every subclass stores keys in a set, so returning a reference might
not always be possible.

Change-Id: If19f81d9ee9ddb5e2ce0133af1a39115f62676a3
diff --git a/src/schema.hpp b/src/schema.hpp
index 2059e1b..96176ab 100644
--- a/src/schema.hpp
+++ b/src/schema.hpp
@@ -73,7 +73,7 @@
     virtual bool leafEnumHasValue(const path_& location, const ModuleNodePair& node, const std::string& value) const = 0;
     virtual bool listHasKey(const path_& location, const ModuleNodePair& node, const std::string& key) const = 0;
     virtual bool nodeExists(const std::string& location, const std::string& node) const = 0;
-    virtual const std::set<std::string>& listKeys(const path_& location, const ModuleNodePair& node) const = 0;
+    virtual const std::set<std::string> listKeys(const path_& location, const ModuleNodePair& node) const = 0;
     virtual yang::LeafDataTypes leafType(const path_& location, const ModuleNodePair& node) const = 0;
     virtual std::set<std::string> childNodes(const path_& path) const = 0;
 
diff --git a/src/static_schema.cpp b/src/static_schema.cpp
index 86dc6fa..1778c68 100644
--- a/src/static_schema.cpp
+++ b/src/static_schema.cpp
@@ -66,7 +66,7 @@
     return list.m_keys.find(key) != list.m_keys.end();
 }
 
-const std::set<std::string>& StaticSchema::listKeys(const path_& location, const ModuleNodePair& node) const
+const std::set<std::string> StaticSchema::listKeys(const path_& location, const ModuleNodePair& node) const
 {
     std::string locationString = pathToAbsoluteSchemaString(location);
     assert(isList(location, node));
diff --git a/src/static_schema.hpp b/src/static_schema.hpp
index 1a84e23..72e23d9 100644
--- a/src/static_schema.hpp
+++ b/src/static_schema.hpp
@@ -33,7 +33,7 @@
     bool leafEnumHasValue(const path_& location, const ModuleNodePair& node, const std::string& value) const override;
     bool listHasKey(const path_& location, const ModuleNodePair& node, const std::string& key) const override;
     bool nodeExists(const std::string& location, const std::string& node) const override;
-    const std::set<std::string>& listKeys(const path_& location, const ModuleNodePair& node) const override;
+    const std::set<std::string> listKeys(const path_& location, const ModuleNodePair& node) const override;
     yang::LeafDataTypes leafType(const path_& location, const ModuleNodePair& node) const override;
     std::set<std::string> childNodes(const path_& path) const override;