!6415 【bugfix】修复gs_increment_build部分内存泄漏点

Merge pull request !6415 from 周聪/bugfix_memecheck_gs_increment_build
This commit is contained in:
opengauss_bot
2024-09-24 11:17:39 +00:00
committed by Gitee
2 changed files with 7 additions and 0 deletions

View File

@ -396,10 +396,13 @@ static BuildErrorCode receiveFileChunks(const char* sql, FILE* file)
switch (PQresultStatus(res)) {
case PGRES_SINGLE_TUPLE:
PQclear(res);
res = nullptr;
break;
case PGRES_TUPLES_OK:
PQclear(res);
res = nullptr;
continue; /* final zero-row result */
default:
@ -500,6 +503,8 @@ static BuildErrorCode receiveFileChunks(const char* sql, FILE* file)
FetchCompressedFile(chunk, (uint32)chunkoff, (int32)chunkspace, (uint16)chunkSize, (uint8)algorithm);
}
PG_CHECKBUILD_AND_FREE_PGRESULT_RETURN(res);
PQclear(res);
res = nullptr;
}
g_progressFlag = true;

View File

@ -733,9 +733,11 @@ bool CheckIfEanbedSaveSlots()
if ((strcmp(optvalue, "1") == 0) || (strcmp(optvalue, "true") == 0) || (strcmp(optvalue, "on") == 0)) {
pg_log(PG_PROGRESS, _("Enable saving confirmed_lsn in target %s\n"), config_file);
freefile(optlines);
optlines = nullptr;
return true;
}
}
freefile(optlines);
optlines = nullptr;
return false;
}