Fix double free issue when attributes are resolved.
authorscantor <scantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Wed, 4 Sep 2013 18:40:02 +0000 (18:40 +0000)
committerSam Hartman <hartmans@painless-security.com>
Thu, 5 Sep 2013 13:39:53 +0000 (09:39 -0400)
git-svn-id: https://svn.shibboleth.net/extensions/cpp-sp-resolver/trunk@360 3ebe4818-3638-0410-822d-ece5924dabe2
(cherry picked from commit d9e69bd8aa4091cc26b1ed41a206e46ec02892f6)

src/shibresolver/resolver.cpp

index dd7bbbf..5648c43 100644 (file)
@@ -517,8 +517,10 @@ void RemotedResolver::resolve(
                     )
                 );
             resolver->resolveAttributes(*ctx.get());
-            if (!ctx->getResolvedAttributes().empty())
+            if (!ctx->getResolvedAttributes().empty()) {
                 resolvedAttrs.insert(resolvedAttrs.end(), ctx->getResolvedAttributes().begin(), ctx->getResolvedAttributes().end());
+                ctx->getResolvedAttributes().clear();
+            }
         }
     }
     catch (exception& ex) {