Remove unnecessary mem contexts in the Manifest object.
The correct context is set by the various *Add() functions so these are not needed and cause leaks, though the leaks will only be noticeable in cases where there are a lot of page checksum errors.
@@ -1761,8 +1761,6 @@ manifestLoadCallback(void *callbackData, const String *section, const String *ke
{
KeyValue *fileKv = varKv(value);
- MEM_CONTEXT_BEGIN(lstMemContext(manifest->pub.fileList))
- {
ManifestFile file =
{
.name = key,
@@ -1846,16 +1844,11 @@ manifestLoadCallback(void *callbackData, const String *section, const String *ke
manifestFileAdd(manifest, &file);
}
- MEM_CONTEXT_END();
- }
// -----------------------------------------------------------------------------------------------------------------------------
else if (strEq(section, MANIFEST_SECTION_TARGET_PATH_STR))
{
KeyValue *pathKv = varKv(value);
-
- MEM_CONTEXT_BEGIN(lstMemContext(manifest->pub.pathList))
- {
ManifestLoadFound valueFound = {0};
ManifestPath path =
@@ -1884,16 +1877,12 @@ manifestLoadCallback(void *callbackData, const String *section, const String *ke
lstAdd(loadData->pathFoundList, &valueFound);
manifestPathAdd(manifest, &path);
}
- MEM_CONTEXT_END();
- }
// -----------------------------------------------------------------------------------------------------------------------------
else if (strEq(section, MANIFEST_SECTION_TARGET_LINK_STR))
{
KeyValue *linkKv = varKv(value);
- MEM_CONTEXT_BEGIN(lstMemContext(manifest->pub.linkList))
- {
ManifestLoadFound valueFound = {0};
ManifestLink link =
@@ -1917,8 +1906,6 @@ manifestLoadCallback(void *callbackData, const String *section, const String *ke
lstAdd(loadData->linkFoundList, &valueFound);
manifestLinkAdd(manifest, &link);
}
- MEM_CONTEXT_END();
- }
// -----------------------------------------------------------------------------------------------------------------------------
else if (strEq(section, MANIFEST_SECTION_TARGET_FILE_DEFAULT_STR))
@@ -1989,8 +1976,6 @@ manifestLoadCallback(void *callbackData, const String *section, const String *ke
{
KeyValue *dbKv = varKv(value);
- MEM_CONTEXT_BEGIN(lstMemContext(manifest->pub.dbList))
- {
ManifestDb db =
{
.name = strDup(key),
@@ -2000,8 +1985,6 @@ manifestLoadCallback(void *callbackData, const String *section, const String *ke
manifestDbAdd(manifest, &db);
}
- MEM_CONTEXT_END();
- }
// -----------------------------------------------------------------------------------------------------------------------------
else if (strEq(section, MANIFEST_SECTION_BACKUP_STR))
