VM Preflet: Use AutoDeleter on the settings

* Prevents a minor memory leak
* Thanks for catching this Axel!
This commit is contained in:
Alexander von Gluck IV
2012-09-13 11:11:36 -05:00
parent 517a59c9a1
commit f78dd1249a
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <AutoDeleter.h>
#include <File.h>
#include <FindDirectory.h>
#include <Path.h>
@@ -138,6 +139,8 @@ Settings::ReadSwapSettings()
void* settings = load_driver_settings(kVirtualMemorySettings);
if (settings == NULL)
return kErrorSettingsNotFound;
CObjectDeleter<void, status_t> settingDeleter(settings,
&unload_driver_settings);
const char* enabled = get_driver_parameter(settings, "vm", NULL, NULL);
const char* automatic = get_driver_parameter(settings, "swap_auto",