[asterisk-commits] mmichelson: branch group/CCSS r238353 - /team/group/CCSS/main/ccss.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 7 10:48:10 CST 2010
Author: mmichelson
Date: Thu Jan 7 10:48:05 2010
New Revision: 238353
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=238353
Log:
Fix a memory management issue in ccss.c
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=238353&r1=238352&r2=238353
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Jan 7 10:48:05 2010
@@ -3281,17 +3281,14 @@
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 = 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);
+ struct ast_control_cc_payload payload;
+ if (cc_build_payload(chan, cc_params, interface_name, dialable_name, service, &payload)) {
return -1;
}
frame->frametype = AST_FRAME_CONTROL;
frame->subclass.integer = AST_CONTROL_CC;
- frame->data.ptr = payload;
- frame->datalen = sizeof(*payload);
- frame->mallocd = AST_MALLOCD_DATA;
+ frame->data.ptr = &payload;
+ frame->datalen = sizeof(payload);
return 0;
}
More information about the asterisk-commits
mailing list