[asterisk-commits] mmichelson: branch 1.6.0 r165322 - in /branches/1.6.0: ./ apps/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 17 15:22:10 CST 2008


Author: mmichelson
Date: Wed Dec 17 15:22:10 2008
New Revision: 165322

URL: http://svn.digium.com/view/asterisk?view=rev&rev=165322
Log:
Merged revisions 165318 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r165318 | mmichelson | 2008-12-17 15:17:20 -0600 (Wed, 17 Dec 2008) | 15 lines

Merged revisions 165255 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165255 | mmichelson | 2008-12-17 14:51:38 -0600 (Wed, 17 Dec 2008) | 7 lines

Fix some memory leaks found while looking at how realtime
configs are handled.

Also cleaned up some coding guidelines violations in app_realtime.c,
mostly related to spacing


........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_directory.c
    branches/1.6.0/apps/app_queue.c
    branches/1.6.0/apps/app_voicemail.c
    branches/1.6.0/res/res_realtime.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_directory.c?view=diff&rev=165322&r1=165321&r2=165322
==============================================================================
--- branches/1.6.0/apps/app_directory.c (original)
+++ branches/1.6.0/apps/app_directory.c Wed Dec 17 15:22:10 2008
@@ -496,6 +496,9 @@
 		if (!cat) {
 			ast_log(LOG_WARNING, "Out of memory\n");
 			ast_config_destroy(cfg);
+			if (rtdata) {
+				ast_config_destroy(rtdata);
+			}
 			return NULL;
 		}
 		ast_category_append(cfg, cat);

Modified: branches/1.6.0/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_queue.c?view=diff&rev=165322&r1=165321&r2=165322
==============================================================================
--- branches/1.6.0/apps/app_queue.c (original)
+++ branches/1.6.0/apps/app_queue.c Wed Dec 17 15:22:10 2008
@@ -2004,8 +2004,12 @@
 
 	/*If the queue is a realtime queue, check to see if it's still defined in real time*/
 	if (q->realtime) {
-		if (!ast_load_realtime("queues", "name", q->name, NULL))
+		struct ast_variable *var;
+		if (!(var = ast_load_realtime("queues", "name", q->name, NULL))) {
 			q->dead = 1;
+		} else {
+			ast_variables_destroy(var);
+		}
 	}
 
 	if (q->dead) {	

Modified: branches/1.6.0/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_voicemail.c?view=diff&rev=165322&r1=165321&r2=165322
==============================================================================
--- branches/1.6.0/apps/app_voicemail.c (original)
+++ branches/1.6.0/apps/app_voicemail.c Wed Dec 17 15:22:10 2008
@@ -8464,6 +8464,8 @@
 	ast_cli(fd,
 		"=============================================================\n"
 		"\n");
+
+	ast_config_destroy(cfg);
 
 	return CLI_SUCCESS;
 }

Modified: branches/1.6.0/res/res_realtime.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_realtime.c?view=diff&rev=165322&r1=165321&r2=165322
==============================================================================
--- branches/1.6.0/res/res_realtime.c (original)
+++ branches/1.6.0/res/res_realtime.c Wed Dec 17 15:22:10 2008
@@ -43,7 +43,7 @@
 static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) 
 {
 #define CRL_HEADER_FORMAT "%30s  %-30s\n"
-	struct ast_variable *var=NULL;
+	struct ast_variable *var = NULL, *orig_var = NULL;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -66,6 +66,7 @@
 	if (var) {
 		ast_cli(a->fd, CRL_HEADER_FORMAT, "Column Name", "Column Value");
 		ast_cli(a->fd, CRL_HEADER_FORMAT, "--------------------", "--------------------");
+		orig_var = var;
 		while (var) {
 			ast_cli(a->fd, CRL_HEADER_FORMAT, var->name, var->value);
 			var = var->next;
@@ -73,6 +74,7 @@
 	} else {
 		ast_cli(a->fd, "No rows found matching search criteria.\n");
 	}
+	ast_variables_destroy(orig_var);
 	return CLI_SUCCESS;
 }
 




More information about the asterisk-commits mailing list