From 296918b6aff488b3596020f31aa4a2068abbe249 Mon Sep 17 00:00:00 2001 From: duzhuolin Date: Thu, 27 Jul 2023 18:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGSQL=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/psql/copy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/psql/copy.cpp b/src/bin/psql/copy.cpp index 0f7bb8b29..401616cc9 100644 --- a/src/bin/psql/copy.cpp +++ b/src/bin/psql/copy.cpp @@ -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; }