Correct the storage data types for the name cache
authorMark Donnelly <mark@painless-security.com>
Wed, 5 Nov 2014 17:43:34 +0000 (12:43 -0500)
committerMark Donnelly <mark@painless-security.com>
Wed, 5 Nov 2014 17:43:34 +0000 (12:43 -0500)
json_gssapi/src/cache/GSSNameCache.cpp
json_gssapi/src/cache/GSSNameCache.h

index f0a6b0f..9d8ff86 100644 (file)
@@ -62,7 +62,7 @@ std::string GSSNameCache::store ( GSSName& data, std::string inKey )
   // Store the key/value pair in the map
   // Store the key in the context for convenience
 //   std::cout << "\n==> In GSSNameCache::store, about to store data in the names hash.\n";
-  names[key] = data;
+  names[key] = &data;
   
   /* Cleanup        */
   /* Return         */
@@ -118,7 +118,7 @@ GSSName& GSSNameCache::retrieve ( std::string key )
   
   /* Cleanup        */
   /* Return         */
-  return names[key];
+  return *(names[key]);
 }
 
 GSSNameCache* GSSNameCache::instance()
index d469b8a..4753cdb 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "datamodel/GSSName.h"
 
-typedef std::map<std::string, GSSName> NameMap;
+typedef std::map<std::string, GSSName*> NameMap;
 
 class GSSNameCache
 {