Steve Singer,,, ssinger at lists.slony.info
Tue Jun 1 08:15:36 PDT 2010
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv26299/src/slon

Modified Files:
	cleanup_thread.c remote_listen.c remote_worker.c 
Log Message:
Memory leak fixes submittedb by Ulrich Weber
http://lists.slony.info/pipermail/slony1-hackers/2010-April/000321.html

Merged from REL_2_0_STABLE


Index: remote_worker.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.186
retrieving revision 1.187
diff -C 2 -d -r1.186 -r1.187
*** remote_worker.c	30 Apr 2010 23:15:55 -0000	1.186
--- remote_worker.c	1 Jun 2010 15:15:33 -0000	1.187
***************
*** 1430,1433 ****
--- 1430,1434 ----
  							rstat = PQresultStatus(res);
  							slon_log(SLON_ERROR, "DDL Statement failed - %s\n", PQresStatus(rstat));
+ 							PQclear(res);
  							dstring_free(&query1);
  							slon_retry();
***************
*** 1535,1538 ****
--- 1536,1540 ----
  	dstring_free(&query1);
  	dstring_free(&query2);
+ 	dstring_free(&query3);
  	free(wd->tab_fqname);
  	free(wd->tab_forward);
***************
*** 2739,2742 ****
--- 2741,2745 ----
  					 "on subscriber\n", node->no_id, tab_fqname);
  			PQclear(res2);
+ 			PQclear(res1);
  			slon_disconnectdb(pro_conn);
  			dstring_free(&query1);
***************
*** 2941,2944 ****
--- 2944,2948 ----
  					 PQresultErrorMessage(res2),
  					 PQerrorMessage(loc_dbconn));
+ 			PQclear(res3);
  			PQclear(res2);
  			PQclear(res1);
***************
*** 2960,2964 ****
  			if (rc < 0)
  			{
! 					PQclear(res3);
  				slon_disconnectdb(pro_conn);
  				dstring_free(&query1);
--- 2964,2970 ----
  			if (rc < 0)
  			{
! 				PQclear(res3);
! 				PQclear(res2);
! 				PQclear(res1);
  				slon_disconnectdb(pro_conn);
  				dstring_free(&query1);
***************
*** 3081,3084 ****
--- 3087,3091 ----
  		 * successful.
  		 */
+ 		PQclear(res3);
  		res3 = PQgetResult(pro_dbconn);
  		if (PQresultStatus(res3) != PGRES_COMMAND_OK)
***************
*** 3122,3125 ****
--- 3129,3133 ----
  			return -1;
  		}
+ 		PQclear(res2);
  		res2 = PQgetResult(loc_dbconn);
  		if (PQresultStatus(res2) != PGRES_COMMAND_OK)

Index: remote_listen.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_listen.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C 2 -d -r1.47 -r1.48
*** remote_listen.c	17 Aug 2009 17:25:50 -0000	1.47
--- remote_listen.c	1 Jun 2010 15:15:33 -0000	1.48
***************
*** 252,255 ****
--- 252,256 ----
  				continue;
  			}
+ 			PQclear(res);
  			rc = db_getLocalNodeId(dbconn);
  			if (rc != node->no_id)
***************
*** 367,370 ****
--- 368,372 ----
  			 "remoteListenThread_%d: thread done\n",
  			 node->no_id);
+ 	dstring_free(&query1);
  	pthread_exit(NULL);
  }

Index: cleanup_thread.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/cleanup_thread.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -C 2 -d -r1.49 -r1.50
*** cleanup_thread.c	9 Dec 2009 20:50:25 -0000	1.49
--- cleanup_thread.c	1 Jun 2010 15:15:33 -0000	1.50
***************
*** 198,202 ****
  							 vacuum_action, tab_nspname, tab_relname);
  				res2 = PQexec(dbconn, dstring_data(&query_pertbl));
! 				vrc = PQresultStatus(res);
  				if (vrc == PGRES_FATAL_ERROR)
  				{
--- 198,202 ----
  							 vacuum_action, tab_nspname, tab_relname);
  				res2 = PQexec(dbconn, dstring_data(&query_pertbl));
! 				vrc = PQresultStatus(res2);
  				if (vrc == PGRES_FATAL_ERROR)
  				{
***************
*** 228,232 ****
  			 */
  			dstring_free(&query_pertbl);
! 
  		}
  	}
--- 228,232 ----
  			 */
  			dstring_free(&query_pertbl);
! 			PQclear(res);
  		}
  	}



More information about the Slony1-commit mailing list