[Asterisk-code-review] Stasis: Use control queue to prevent crash. (asterisk[13])

Kevin Harwell asteriskteam at digium.com
Fri Jan 22 14:11:07 CST 2016


Kevin Harwell has posted comments on this change.

Change subject: Stasis: Use control queue to prevent crash.
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/2056/2/res/stasis/control.c
File res/stasis/control.c:

Line 375: 	if (stasis_app_send_command_async(control, app_control_add_role, role_dup, ast_free_ptr)) {
        : 		ast_free(role_dup);
        : 		return -1;
        : 	}
I think this has the potential of a "double free". If you follow the code all the way down into command_create then if the command fails to create it will call the data_destructor, return NULL, and in turn -1 here. Which then attempts to free the string a second time here.


Line 648: 	if (stasis_app_send_command_async(control, app_control_set_channel_var, var, ast_free_ptr)) {
        : 		ast_free(var);
        : 		return -1;
        : 	}
Same problem here with a potential "double free"


-- 
To view, visit https://gerrit.asterisk.org/2056
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2a0a4d51bce6fba6f1d9954e40935e42f366ea78
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list