[asterisk-commits] dlee: branch dlee/stasis-core r382283 - in /team/dlee/stasis-core: main/ tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 28 14:19:11 CST 2013


Author: dlee
Date: Thu Feb 28 14:19:07 2013
New Revision: 382283

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382283
Log:
Addressing opticron's review comments.

Modified:
    team/dlee/stasis-core/main/channel.c
    team/dlee/stasis-core/main/manager.c
    team/dlee/stasis-core/main/stasis.c
    team/dlee/stasis-core/tests/test_stasis.c

Modified: team/dlee/stasis-core/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-core/main/channel.c?view=diff&rev=382283&r1=382282&r2=382283
==============================================================================
--- team/dlee/stasis-core/main/channel.c (original)
+++ team/dlee/stasis-core/main/channel.c Thu Feb 28 14:19:07 2013
@@ -272,6 +272,10 @@
 	}
 	event->variable = ast_strdup(name);
 	event->value = ast_strdup(value);
+	if (event->channel_name == NULL || event->uniquid == NULL || event->variable == NULL || event->value == NULL) {
+		ast_log(LOG_ERROR, "Allocation failed\n");
+		return;
+	}
 
 	msg = stasis_message_create(ast_channel_varset_event(), event);
 	if (!msg) {

Modified: team/dlee/stasis-core/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-core/main/manager.c?view=diff&rev=382283&r1=382282&r2=382283
==============================================================================
--- team/dlee/stasis-core/main/manager.c (original)
+++ team/dlee/stasis-core/main/manager.c Thu Feb 28 14:19:07 2013
@@ -7482,7 +7482,7 @@
 	char *manager_event = NULL;
 
 	if (!new_snapshot) {
-		/* Ignore cache clearing events; we'll se the hangup first */
+		/* Ignore cache clearing events; we'll see the hangup first */
 		return;
 	}
 

Modified: team/dlee/stasis-core/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-core/main/stasis.c?view=diff&rev=382283&r1=382282&r2=382283
==============================================================================
--- team/dlee/stasis-core/main/stasis.c (original)
+++ team/dlee/stasis-core/main/stasis.c Thu Feb 28 14:19:07 2013
@@ -309,7 +309,11 @@
 		SCOPED_AO2LOCK(lock, topic);
 		num_subscribers = topic->num_subscribers_current;
 		subscribers = ast_malloc(num_subscribers * sizeof(*subscribers));
-		memcpy(subscribers, topic->subscribers, num_subscribers * sizeof(*subscribers));
+		if (subscribers) {
+			memcpy(subscribers,
+			       topic->subscribers,
+			       num_subscribers * sizeof(*subscribers));
+		}
 	}
 
 	if (!subscribers) {
@@ -327,7 +331,7 @@
 
 			dispatch = dispatch_create(publisher_topic, message, sub);
 			if (!dispatch) {
-				ast_log(LOG_DEBUG, "Allocation failure; dropping message\n");
+				ast_log(LOG_DEBUG, "Allocation failure; dropping dispatch\n");
 				break;
 			}
 

Modified: team/dlee/stasis-core/tests/test_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-core/tests/test_stasis.c?view=diff&rev=382283&r1=382282&r2=382283
==============================================================================
--- team/dlee/stasis-core/tests/test_stasis.c (original)
+++ team/dlee/stasis-core/tests/test_stasis.c Thu Feb 28 14:19:07 2013
@@ -545,24 +545,6 @@
 	return AST_TEST_PASS;
 }
 
-/*
-AST_TEST_DEFINE()
-{
-	switch (cmd) {
-	case TEST_INIT:
-		info->name = __func__;
-		info->category = test_category;
-		info->summary = "";
-		info->description = "";
-		return AST_TEST_NOT_RUN;
-	case TEST_EXECUTE:
-		break;
-	}
-
-	return AST_TEST_PASS;
-}
-*/
-
 static int unload_module(void)
 {
 	AST_TEST_UNREGISTER(message_type);




More information about the asterisk-commits mailing list