Fix multiple memory leaks in PLy_spi_execute_fetch_result: it would leak memory if the result had zero rows, and also if there was any sort of error while converting the result tuples into Python data.  Reported and partially fixed by Andres Freund.
Fix multiple memory leaks in PLy_spi_execute_fetch_result: it would leak
memory if the result had zero rows, and also if there was any sort of error
while converting the result tuples into Python data.  Reported and partially
fixed by Andres Freund.

Back-patch to all supported versions.  Note: I haven't tested the 7.4 fix.
7.4's configure check for python is so obsolete it doesn't work on my
current machines :-(.  The logic change is pretty straightforward though.

ashwinstar/gpdb,Postgres-XL/Postgres-XL,kmjungersen/PostgresXL,techdragon/Postgres-XL,postmind-net/postgres-xl,ashwinstar/gpdb,snaga/postgres-xl,lisakowen/gpdb,ovr/postgres-xl,oberstet/postgres-xl,greenplum-db/gpdb,arcivanov/postgres-xl,50wu/gpdb,ashwinstar/gpdb,pavanvd/postgres-xl,Postgres-XL/Postgres-XL,xinzweb/gpdb,lisakowen/gpdb,xinzweb/gpdb,postmind-net/postgres-xl,adam8157/gpdb,yazun/postgres-xl,50wu/gpdb,zeroae/postgres-xl,postmind-net/postgres-xl,jmcatamney/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,greenplum-db/gpdb,adam8157/gpdb,arcivanov/postgres-xl,techdragon/Postgres-XL,lisakowen/gpdb,ashwinstar/gpdb,xinzweb/gpdb,ashwinstar/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,greenplum-db/gpdb,snaga/postgres-xl,ashwinstar/gpdb,50wu/gpdb,yazun/postgres-xl,adam8157/gpdb,ovr/postgres-xl,ovr/postgres-xl,xinzweb/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,pavanvd/postgres-xl,postmind-net/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,kmjungersen/PostgresXL,ashwinstar/gpdb,techdragon/Postgres-XL,zeroae/postgres-xl,greenplum-db/gpdb,lisakowen/gpdb,Postgres-XL/Postgres-XL,techdragon/Postgres-XL,zeroae/postgres-xl,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb,jmcatamney/gpdb,yazun/postgres-xl,xinzweb/gpdb,50wu/gpdb,oberstet/postgres-xl,zeroae/postgres-xl,kmjungersen/PostgresXL,jmcatamney/gpdb,oberstet/postgres-xl,yazun/postgres-xl,pavanvd/postgres-xl,oberstet/postgres-xl,adam8157/gpdb,50wu/gpdb,jmcatamney/gpdb,adam8157/gpdb,tpostgres-projects/tPostgres,tpostgres-projects/tPostgres,arcivanov/postgres-xl,yazun/postgres-xl,lisakowen/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,ashwinstar/gpdb,tpostgres-projects/tPostgres,adam8157/gpdb,jmcatamney/gpdb,kmjungersen/PostgresXL,jmcatamney/gpdb,arcivanov/postgres-xl,arcivanov/postgres-xl,zeroae/postgres-xl,postmind-net/postgres-xl,snaga/postgres-xl,Postgres-XL/Postgres-XL,adam8157/gpdb,kmjungersen/PostgresXL,50wu/gpdb,tpostgres-projects/tPostgres,50wu/gpdb,pavanvd/postgres-xl,ovr/postgres-xl,jmcatamney/gpdb,Postgres-XL/Postgres-XL,ovr/postgres-xl,snaga/postgres-xl