Fix minor memory leak introduced in recent SQL-functions hacking: the
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Nov 2008 00:10:04 +0000 (00:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Nov 2008 00:10:04 +0000 (00:10 +0000)
DestReceiver created during postquel_start needs to be destroyed during
postquel_end.  In a moment of brain fade I had assumed this would be taken
care of by FreeQueryDesc, but it's not (and shouldn't be).

src/backend/executor/functions.c

index d7b3675540fc2e6987ea1b3c577e69671fec529b..29fae145cb9eea73434485fd20d11992ed76914f 100644 (file)
@@ -501,6 +501,8 @@ postquel_end(execution_state *es)
                PopActiveSnapshot();
        }
 
+       (*es->qd->dest->rDestroy) (es->qd->dest);
+
        FreeQueryDesc(es->qd);
        es->qd = NULL;
 }