Fix leak in aidl_unittests
Turning on "sanitizer: address" revealed the leak in the test code.
Bug: n/a
Test: aidl_unittests
Change-Id: Id13820cff676d998934d6b1485d453f37397d696
diff --git a/aidl_language.h b/aidl_language.h
index d32ee24..973f20c 100644
--- a/aidl_language.h
+++ b/aidl_language.h
@@ -252,9 +252,9 @@
static std::string TypeToString(Type type);
- static AidlAnnotation* Parse(
+ static std::unique_ptr<AidlAnnotation> Parse(
const AidlLocation& location, const string& name,
- std::map<std::string, std::shared_ptr<AidlConstantValue>>* parameter_list,
+ std::map<std::string, std::shared_ptr<AidlConstantValue>> parameter_list,
const Comments& comments);
AidlAnnotation(const AidlAnnotation&) = default;
@@ -306,7 +306,7 @@
static const std::vector<Schema>& AllSchemas();
AidlAnnotation(const AidlLocation& location, const Schema& schema,
- std::map<std::string, std::shared_ptr<AidlConstantValue>>&& parameters,
+ std::map<std::string, std::shared_ptr<AidlConstantValue>> parameters,
const Comments& comments);
const Schema& schema_;