Merge "CHAOS: cleanup possible null vars on msg alloc failure" into 13

This commit is contained in:
Joshua Colp
2016-03-02 18:11:59 -06:00
committed by Gerrit Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -398,7 +398,7 @@ static void msg_destructor(void *obj)
struct ast_msg *msg = obj; struct ast_msg *msg = obj;
ast_string_field_free_memory(msg); ast_string_field_free_memory(msg);
ao2_ref(msg->vars, -1); ao2_cleanup(msg->vars);
} }
struct ast_msg *ast_msg_alloc(void) struct ast_msg *ast_msg_alloc(void)

View File

@@ -601,7 +601,7 @@ static int sip_msg_send(const struct ast_msg *msg, const char *to, const char *f
if (!(mdata = msg_data_create(msg, to, from)) || if (!(mdata = msg_data_create(msg, to, from)) ||
ast_sip_push_task(message_serializer, msg_send, mdata)) { ast_sip_push_task(message_serializer, msg_send, mdata)) {
ao2_ref(mdata, -1); ao2_cleanup(mdata);
return -1; return -1;
} }
return 0; return 0;