--- main/pbx.c 2016-06-06 11:31:34.916512387 -0400 +++ main/pbx.c 2016-06-06 11:32:57.594466442 -0400 @@ -6078,7 +6078,7 @@ struct ast_hint *hint = data; struct ast_str *hint_app; int state; - struct presencechange presence_state; + struct presencechange presence_state = {}; if (!(hint_app = ast_str_create(1024))) { return -1; @@ -6096,8 +6096,12 @@ ast_free(hint_app); ao2_ref(hint, -1); - ast_free(presence_state.subtype); - ast_free(presence_state.message); + if (presence_state.subtype) { + ast_free(presence_state.subtype); + } + if (presence_state.message) { + ast_free(presence_state.message); + } return 0; }