Fix memory leak
After parsing the command line arguments, ArgumentParser does a release of
unique pointer which will just release the ownership. This pointer is then
never cleaned up resulting in leak. Fix is to reset the unique_ptr to null
Change-Id: Ifa69399e2440547947b214dc4a36c3065b6ff608
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/readd.cpp b/readd.cpp
index 35523d9..4876723 100644
--- a/readd.cpp
+++ b/readd.cpp
@@ -27,8 +27,8 @@
exit_with_error("Path not specified.", argv);
}
- // Finished getting options out, so release the parser.
- options.release();
+ // Finished getting options out, so cleanup the parser.
+ options.reset();
// Check sysfs for available sensors.
auto sensors = std::make_unique<SensorSet>(path);