Add temporary mem context to removeExpiredBackup().
This was not really a leak since memory was being freed by the calling function, but this function does enough work to deserve its own memory context.
Also fixed a doubled semicolon.
@@ -795,6 +795,8 @@ removeExpiredBackup(InfoBackup *infoBackup, const String *adhocBackupLabel, unsi
ASSERT(infoBackup != NULL);
+ MEM_CONTEXT_TEMP_BEGIN()
+ {
// Get all the current backups in backup.info - these will not be expired
StringList *currentBackupList = strLstSort(infoBackupDataLabelList(infoBackup, NULL), sortOrderDesc);
@@ -844,7 +846,8 @@ removeExpiredBackup(InfoBackup *infoBackup, const String *adhocBackupLabel, unsi
if (!strLstExists(currentBackupList, strLstGet(backupList, backupIdx)))
{
LOG_INFO_FMT(
- "%s: remove expired backup %s", cfgOptionGroupName(cfgOptGrpRepo, repoIdx), strZ(strLstGet(backupList, backupIdx)));
+ "%s: remove expired backup %s", cfgOptionGroupName(cfgOptGrpRepo, repoIdx),
+ strZ(strLstGet(backupList, backupIdx)));
// Execute the real expiration and deletion only if the dry-run mode is disabled
if (!cfgOptionValid(cfgOptDryRun) || !cfgOptionBool(cfgOptDryRun))
@@ -855,6 +858,8 @@ removeExpiredBackup(InfoBackup *infoBackup, const String *adhocBackupLabel, unsi
}
}
}
+ }
+ MEM_CONTEXT_TEMP_END();
FUNCTION_LOG_RETURN_VOID();
}
@@ -1065,7 +1070,7 @@ cmdExpire(void)
CATCH_ANY()
{
LOG_ERROR_FMT(errorTypeCode(errorType()), "%s: %s", cfgOptionGroupName(cfgOptGrpRepo, repoIdx), errorMessage());
- errorTotal++;;
+ errorTotal++;
}
TRY_END();
}
