diff --git a/src/storage/remote/protocol.c b/src/storage/remote/protocol.c index 21441eaf8..211688cd1 100644 --- a/src/storage/remote/protocol.c +++ b/src/storage/remote/protocol.c @@ -172,7 +172,6 @@ storageRemoteFeatureProtocol(PackRead *const param, ProtocolServer *const server /**********************************************************************************************************************************/ typedef struct StorageRemoteInfoProcotolWriteData { - MemContext *memContext; // Mem context used to store values from last call time_t timeModifiedLast; // timeModified from last call mode_t modeLast; // mode from last call uid_t userIdLast; // userId from last call @@ -240,36 +239,22 @@ storageRemoteInfoProtocolPut( pckWriteStrP(write, info->linkDestination); } - // Store defaults to use for the next call. If memContext is NULL this function is only being called one time so there is no - // point in storing defaults. - if (data->memContext != NULL) + // Store defaults to use for the next call + data->timeModifiedLast = info->timeModified; + data->modeLast = info->mode; + data->userIdLast = info->userId; + data->groupIdLast = info->groupId; + + if (info->user != NULL && !strEq(info->user, data->user)) // {vm_covered} { - data->timeModifiedLast = info->timeModified; - data->modeLast = info->mode; - data->userIdLast = info->userId; - data->groupIdLast = info->groupId; + strFree(data->user); + data->user = strDup(info->user); + } - if (info->user != NULL && !strEq(info->user, data->user)) // {vm_covered} - { - strFree(data->user); - - MEM_CONTEXT_BEGIN(data->memContext) - { - data->user = strDup(info->user); - } - MEM_CONTEXT_END(); - } - - if (info->group != NULL && !strEq(info->group, data->group)) // {vm_covered} - { - strFree(data->group); - - MEM_CONTEXT_BEGIN(data->memContext) - { - data->group = strDup(info->group); - } - MEM_CONTEXT_END(); - } + if (info->group != NULL && !strEq(info->group, data->group)) // {vm_covered} + { + strFree(data->group); + data->group = strDup(info->group); } FUNCTION_TEST_RETURN_VOID(); @@ -355,7 +340,7 @@ storageRemoteListProtocol(PackRead *const param, ProtocolServer *const server) { const String *const path = pckReadStrP(param); const StorageInfoLevel level = (StorageInfoLevel)pckReadU32P(param); - StorageRemoteInfoProtocolWriteData writeData = {.memContext = memContextCurrent()}; + StorageRemoteInfoProtocolWriteData writeData = {0}; StorageList *const list = storageInterfaceListP(storageRemoteProtocolLocal.driver, path, level); // Put list