pluginprocess: fix memleak in tests
@@ -39,17 +39,18 @@ static int elektraDummyOpen (Plugin * handle, Key * errorKey)
static int elektraDummyClose (Plugin * handle, Key * errorKey)
{
ElektraPluginProcess * pp = elektraPluginGetData (handle);
- if (pp && elektraPluginProcessIsParent (pp))
+ if (pp)
{
int * testData = (int *) elektraPluginProcessGetData (pp);
- ElektraPluginProcessCloseResult result = elektraPluginProcessClose (pp, errorKey);
- if (result.cleanedUp)
- {
elektraPluginSetData (handle, NULL);
elektraFree (testData);
- }
+
+ if (elektraPluginProcessIsParent (pp))
+ {
+ ElektraPluginProcessCloseResult result = elektraPluginProcessClose (pp, errorKey);
return result.result;
}
+ }
keySetMeta (errorKey, "user/tests/pluginprocess/close", "");
return ELEKTRA_PLUGIN_STATUS_SUCCESS;
