Chris Browne cbbrowne at lists.slony.info
Thu Mar 11 13:38:07 PST 2010
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv11819

Modified Files:
      Tag: REL_1_2_STABLE
	remote_listen.c remote_worker.c 
Log Message:
Apparently fixes to memory leaks via freeing values at more apropos times


Index: remote_worker.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_worker.c,v
retrieving revision 1.124.2.41
retrieving revision 1.124.2.42
diff -C 2 -d -r1.124.2.41 -r1.124.2.42
*** remote_worker.c	22 Feb 2010 18:45:02 -0000	1.124.2.41
--- remote_worker.c	11 Mar 2010 21:38:04 -0000	1.124.2.42
***************
*** 1390,1393 ****
--- 1390,1394 ----
  						rstat = PQresultStatus(res);
  						slon_log (SLON_CONFIG, "DDL success - %s\n", PQresStatus(rstat));
+ 						PQclear(res);
  					}
  					slon_log(SLON_INFO, "completed DDL script - run ddlScript_complete_int()\n");
***************
*** 1485,1488 ****
--- 1486,1490 ----
  	dstring_free(&query1);
  	dstring_free(&query2);
+ 	dstring_free(&lsquery);
  	free(wd->tab_fqname);
  	free(wd->tab_forward);
***************
*** 4917,4920 ****
--- 4919,4923 ----
  		{
  			dstring_free(&query);
+ 			dstring_free(&query2);
  			pthread_mutex_unlock(&(provider->helper_lock));
  			pthread_exit(NULL);
***************
*** 5308,5311 ****
--- 5311,5315 ----
  						log_cmddata = PQgetvalue(res2, 0, 0);
  						largemem = log_cmdsize;
+ 						PQclear(res2);
  					}
  
***************
*** 5393,5397 ****
  					if (largemem > 0)
  					{
- 						PQclear(res2);
  						pthread_mutex_lock(&(wd->workdata_lock));
  						wd->workdata_largemem += largemem;
--- 5397,5400 ----

Index: remote_listen.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/remote_listen.c,v
retrieving revision 1.31.2.5
retrieving revision 1.31.2.6
diff -C 2 -d -r1.31.2.5 -r1.31.2.6
*** remote_listen.c	22 Dec 2009 17:10:10 -0000	1.31.2.5
--- remote_listen.c	11 Mar 2010 21:38:04 -0000	1.31.2.6
***************
*** 267,270 ****
--- 267,271 ----
  					 node->no_id,
  					 dstring_data(&query1), PQresultErrorMessage(res));
+ 				dstring_free(&query1);
  				PQclear(res);
  				slon_disconnectdb(conn);
***************
*** 342,345 ****
--- 343,347 ----
  		}
  		if (oldpstate != poll_state) { /* Switched states... */
+ 			dstring_init(&query1);
  			switch (poll_state) {
  			case SLON_POLLSTATE_POLL:
***************
*** 368,371 ****
--- 370,374 ----
  					 node->no_id,
  					 dstring_data(&query1), PQresultErrorMessage(res));
+ 				dstring_free(&query1);
  				PQclear(res);
  				slon_disconnectdb(conn);
***************
*** 375,378 ****
--- 378,382 ----
  				continue;
  			}
+ 			dstring_free(&query1);
  			PQclear(res);
  		}



More information about the Slony1-commit mailing list