mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
pjsip_cli: Fix memory leak in ast_sip_cli_print_sorcery_objectset.
Fixed memory leaks in ast_sip_cli_print_sorcery_objectset and ast_variable_list_sort. (closes issue ASTERISK-23266) Review: http://reviewboard.asterisk.org/r/3200/ ........ Merged revisions 408520 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -71,9 +71,8 @@ int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (!(separator = alloca(max_name_width + max_value_width + 8))) {
|
||||
return -1;
|
||||
}
|
||||
separator = ast_alloca(max_name_width + max_value_width + 8);
|
||||
|
||||
memset(separator, '=', max_name_width + max_value_width + 3);
|
||||
separator[max_name_width + max_value_width + 3] = 0;
|
||||
|
||||
@@ -86,6 +85,8 @@ int ast_sip_cli_print_sorcery_objectset(void *obj, void *arg, int flags)
|
||||
ast_str_append(&context->output_buffer, 0, " %-*s : %s\n", max_name_width, i->name, i->value);
|
||||
}
|
||||
|
||||
ast_variables_destroy(objset);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user