Use MEM_CONTEXT_BEGIN() block instead of memContextSwitch().
This is the standard pattern but was missed here.
@@ -827,12 +827,12 @@ storageS3PathRemoveCallback(StorageS3 *this, void *callbackData, const String *n
// If there is something to delete then create the request
if (data->xml == NULL)
{
- MemContext *memContextOld = memContextSwitch(data->memContext);
-
+ MEM_CONTEXT_BEGIN(data->memContext)
+ {
data->xml = xmlDocumentNew(S3_XML_TAG_DELETE_STR);
xmlNodeContentSet(xmlNodeAdd(xmlDocumentRoot(data->xml), S3_XML_TAG_QUIET_STR), TRUE_STR);
-
- memContextSwitch(memContextOld);
+ }
+ MEM_CONTEXT_END();
}
// Add to delete list
