fix curlget memleak
@@ -637,6 +637,7 @@ int elektraCurlgetGet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned ELEKTRA
{
UNLINK_TMP:
// remote file is the same as our local copy
+ if(data->tmpFile)
unlink (data->tmpFile);
data->tmpFile = NULL;
keySetString (parentKey, data->path);
@@ -674,6 +675,8 @@ int elektraCurlgetSet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned ELEKTRA
ELEKTRA_SET_ERROR (ELEKTRA_ERROR_CONFLICT, parentKey, "remote file has changed");
retval = -1;
}
+ elektraFree(hash);
+ if(data->tmpFile)
unlink (data->tmpFile);
data->tmpFile = NULL;
keySetString (parentKey, name);
@@ -694,7 +697,7 @@ int elektraCurlgetSet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned ELEKTRA
if (retval != -1)
{
keySetString (parentKey, name);
- data->tmpFile = keyString (parentKey);
+ data->tmpFile = name;
retval = 1;
}
if (!data->useLocalCopy && data->path)
