[asterisk-commits] jrose: branch 12 r401706 - in /branches/12: ./ channels/ codecs/ilbc/ main/ u...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 24 11:58:32 CDT 2013


Author: jrose
Date: Thu Oct 24 11:58:30 2013
New Revision: 401706

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401706
Log:
memory leaks: Memory leak cleanup patch by Corey Farrell (second set)

Also covers ast_app_parse_timelen-fail-zero-length.patch, but the patch was
replaced with one of my own.

(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
    chan_dahdi-cleanup_push.patch uploaded by coreyfarrell (license 5909)
    clicompat-r2.patch uploaded by coreyfarrell (license 5909)
    codecs-ilbc-doCPLC.patch uploaded by coreyfarrell (license 5909)
    data-cleanup-test-registration.patch uploaded by coreyfarrell (license 5909)
    main-asterisk-kill-listener.patch uploaded by coreyfarrell (license 5909)
........

Merged revisions 401704 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 401705 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/12/   (props changed)
    branches/12/channels/chan_dahdi.c
    branches/12/codecs/ilbc/doCPLC.c
    branches/12/main/app.c
    branches/12/main/asterisk.c
    branches/12/main/data.c
    branches/12/utils/clicompat.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_dahdi.c?view=diff&rev=401706&r1=401705&r2=401706
==============================================================================
--- branches/12/channels/chan_dahdi.c (original)
+++ branches/12/channels/chan_dahdi.c Thu Oct 24 11:58:30 2013
@@ -11146,6 +11146,11 @@
 	return NULL;
 }
 
+static void monitor_pfds_clean(void *arg) {
+	struct pollfd **pfds = arg;
+	ast_free(*pfds);
+}
+
 static void *do_monitor(void *data)
 {
 	int count, res, res2, spoint, pollres=0;
@@ -11169,6 +11174,7 @@
 #endif
 	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 
+	pthread_cleanup_push(monitor_pfds_clean, &pfds);
 	for (;;) {
 		/* Lock the interface list */
 		ast_mutex_lock(&iflock);
@@ -11424,6 +11430,7 @@
 		ast_mutex_unlock(&iflock);
 	}
 	/* Never reached */
+	pthread_cleanup_pop(1);
 	return NULL;
 
 }

Modified: branches/12/codecs/ilbc/doCPLC.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/codecs/ilbc/doCPLC.c?view=diff&rev=401706&r1=401705&r2=401706
==============================================================================
--- branches/12/codecs/ilbc/doCPLC.c (original)
+++ branches/12/codecs/ilbc/doCPLC.c Thu Oct 24 11:58:30 2013
@@ -90,7 +90,7 @@
        int lag=20, randlag;
        float gain, maxcc;
        float use_gain;
-       float gain_comp, maxcc_comp, per, max_per;
+       float gain_comp, maxcc_comp, per, max_per=0;
        int i, pick, use_lag;
        float ftmp, randvec[BLOCKL_MAX], pitchfact, energy;
 

Modified: branches/12/main/app.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/app.c?view=diff&rev=401706&r1=401705&r2=401706
==============================================================================
--- branches/12/main/app.c (original)
+++ branches/12/main/app.c Thu Oct 24 11:58:30 2013
@@ -2786,7 +2786,9 @@
 		return -1;
 	}
 
-	if ((res = sscanf(timestr, FMT, &amount, u)) == 0) {
+	res = sscanf(timestr, FMT, &amount, u);
+
+	if (res == 0 || res == EOF) {
 #undef FMT
 		return -1;
 	} else if (res == 2) {

Modified: branches/12/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/asterisk.c?view=diff&rev=401706&r1=401705&r2=401706
==============================================================================
--- branches/12/main/asterisk.c (original)
+++ branches/12/main/asterisk.c Thu Oct 24 11:58:30 2013
@@ -1975,11 +1975,17 @@
 		close(ast_socket);
 		ast_socket = -1;
 		unlink(ast_config_AST_SOCKET);
+		pthread_kill(lthread, SIGURG);
+		pthread_join(lthread, NULL);
 	}
 	if (ast_consock > -1)
 		close(ast_consock);
 	if (!ast_opt_remote)
 		unlink(ast_config_AST_PID);
+	if (sig_alert_pipe[0])
+		close(sig_alert_pipe[0]);
+	if (sig_alert_pipe[1])
+		close(sig_alert_pipe[1]);
 	printf("%s", term_quit());
 	if (restart) {
 		int i;

Modified: branches/12/main/data.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/data.c?view=diff&rev=401706&r1=401705&r2=401706
==============================================================================
--- branches/12/main/data.c (original)
+++ branches/12/main/data.c Thu Oct 24 11:58:30 2013
@@ -3313,6 +3313,7 @@
 	ao2_t_ref(root_data.container, -1, "Unref root_data.container in data_shutdown");
 	root_data.container = NULL;
 	ast_rwlock_destroy(&root_data.lock);
+	AST_TEST_UNREGISTER(test_data_get);
 }
 
 int ast_data_init(void)
@@ -3330,9 +3331,7 @@
 
 	res |= ast_manager_register_xml_core("DataGet", 0, manager_data_get);
 
-#ifdef TEST_FRAMEWORK
 	AST_TEST_REGISTER(test_data_get);
-#endif
 
 	ast_register_atexit(data_shutdown);
 

Modified: branches/12/utils/clicompat.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/utils/clicompat.c?view=diff&rev=401706&r1=401705&r2=401706
==============================================================================
--- branches/12/utils/clicompat.c (original)
+++ branches/12/utils/clicompat.c Thu Oct 24 11:58:30 2013
@@ -9,8 +9,18 @@
 
 struct ast_cli_entry;
 
+int ast_register_atexit(void (*func)(void));
+int ast_register_atexit(void (*func)(void))
+{
+	return 0;
+}
 int ast_cli_register_multiple(struct ast_cli_entry *e, int len);
 int ast_cli_register_multiple(struct ast_cli_entry *e, int len)
 {
 	return 0;
 }
+int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len);
+int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
+{
+	return 0;
+}




More information about the asterisk-commits mailing list