!3852 修复GSQL内存泄露

Merge pull request !3852 from duzhuolin/bugfix_Q8
This commit is contained in:
opengauss_bot
2023-07-31 02:09:40 +00:00
committed by Gitee

View File

@ -768,6 +768,8 @@ bool handleCopyIn(PGconn* conn, FILE* copystream, bool isbinary)
if (strncmp((const char*)pset.decryptInfo.decryptBuff, "\\.\n", strlen("\\.\n")) == 0 ||
strncmp((const char*)pset.decryptInfo.decryptBuff, "\\.\r\n", strlen("\\.\n")) == 0) {
copydone = true;
free(pset.decryptInfo.decryptBuff);
pset.decryptInfo.decryptBuff = NULL;
break;
}
@ -777,6 +779,8 @@ bool handleCopyIn(PGconn* conn, FILE* copystream, bool isbinary)
if (PQputCopyData(conn, (const char*)pset.decryptInfo.decryptBuff, linelen) <= 0) {
OK = false;
copydone = true;
free(pset.decryptInfo.decryptBuff);
pset.decryptInfo.decryptBuff = NULL;
break;
}