[asterisk-commits] mmichelson: branch group/CCSS r238355 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 7 11:00:55 CST 2010


Author: mmichelson
Date: Thu Jan  7 11:00:51 2010
New Revision: 238355

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=238355
Log:
revert my memory management fix patch. It was ill-conceived.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=238355&r1=238354&r2=238355
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Jan  7 11:00:51 2010
@@ -3315,14 +3315,17 @@
 int ast_cc_build_frame(struct ast_channel *chan, struct ast_cc_config_params *cc_params, const char * const interface_name,
 		const char * const dialable_name, enum ast_cc_service_type service, struct ast_frame *frame)
 {
-	struct ast_control_cc_payload payload;
-	if (cc_build_payload(chan, cc_params, interface_name, dialable_name, service, &payload)) {
+	struct ast_control_cc_payload *payload = ast_calloc(1, sizeof(*payload));
+	if (cc_build_payload(chan, cc_params, interface_name, dialable_name, service, payload)) {
+		/* Something screwed up, we can't make a frame with this */
+		ast_free(payload);
 		return -1;
 	}
 	frame->frametype = AST_FRAME_CONTROL;
 	frame->subclass.integer = AST_CONTROL_CC;
-	frame->data.ptr = &payload;
-	frame->datalen = sizeof(payload);
+	frame->data.ptr = payload;
+	frame->datalen = sizeof(*payload);
+	frame->mallocd = AST_MALLOCD_DATA;
 	return 0;
 }
 




More information about the asterisk-commits mailing list