Skip to content

Commit

Permalink
fix single tuple result memory leak (#6724)
Browse files Browse the repository at this point in the history
We should not omit to free PGResult when we receive single tuple result
from an internal backend.
Single tuple results are normally freed by our ReceiveResults for
`tupleDescriptor != NULL` flow but not for those with `tupleDescriptor
== NULL`. See PR #6722 for details.

DESCRIPTION: Fixes memory leak issue with query results that returns
single row.
  • Loading branch information
aykut-bozkurt authored and emelsimsek committed Mar 6, 2023
1 parent f7d1292 commit d5c1c3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/backend/distributed/executor/adaptive_executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -4777,6 +4777,7 @@ ReceiveResults(WorkerSession *session, bool storeRows)
TupleDesc tupleDescriptor = tupleDest->tupleDescForQuery(tupleDest, queryIndex);
if (tupleDescriptor == NULL)
{
PQclear(result);
continue;
}

Expand Down

0 comments on commit d5c1c3b

Please sign in to comment.