Use unique_ptr instead of calling free directly
Seems kind of silly, but sure, whatever you say clang-tidy.
Change-Id: Ieefaf3ee9d18eeee0d02ae8b2cd2873b52741cb6
diff --git a/src/yang_access.cpp b/src/yang_access.cpp
index 7ca30a2..8277ef1 100644
--- a/src/yang_access.cpp
+++ b/src/yang_access.cpp
@@ -267,10 +267,10 @@
{
char* output;
lyd_print_mem(&output, m_datastore.get(), format == DataFormat::Xml ? LYD_XML : LYD_JSON, LYP_WITHSIBLINGS | LYP_FORMAT);
+ std::unique_ptr<char, decltype(&free)> deleter{output, free};
if (output) {
std::string res = output;
- free(output);
return res;
}