!2259 【轻量级 PR】:修复libpqwalreceiver内存泄漏问题

Merge pull request !2259 from chenxiaobin/N/A
This commit is contained in:
opengauss-bot
2022-09-29 12:40:37 +00:00
committed by Gitee

View File

@ -1355,10 +1355,12 @@ bool libpqrcv_receive(int timeout, unsigned char *type, char **buffer, int *len)
/* Verify that there are no more results */
res = PQgetResult(t_thrd.libwalreceiver_cxt.streamConn);
if (res != NULL)
if (res != NULL) {
PQclear(res);
ereport(ERROR,
(errmsg("unexpected result after CommandComplete: %s",
PQerrorMessage(t_thrd.libwalreceiver_cxt.streamConn))));
}
*len = -1;
return false;
}