mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 20:56:39 +00:00
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -132,13 +132,13 @@ static void erds_destroy(struct enum_result_datastore *data)
|
||||
int k;
|
||||
|
||||
for (k = 0; k < data->context->naptr_rrs_count; k++) {
|
||||
free(data->context->naptr_rrs[k].result);
|
||||
free(data->context->naptr_rrs[k].tech);
|
||||
ast_free(data->context->naptr_rrs[k].result);
|
||||
ast_free(data->context->naptr_rrs[k].tech);
|
||||
}
|
||||
|
||||
free(data->context->naptr_rrs);
|
||||
free(data->context);
|
||||
free(data);
|
||||
ast_free(data->context->naptr_rrs);
|
||||
ast_free(data->context);
|
||||
ast_free(data);
|
||||
}
|
||||
|
||||
static void erds_destroy_cb(void *data)
|
||||
@@ -191,7 +191,7 @@ static int enum_query_read(struct ast_channel *chan, const char *cmd, char *data
|
||||
goto finish;
|
||||
|
||||
if (!(erds->context = ast_calloc(1, sizeof(*erds->context)))) {
|
||||
free(erds);
|
||||
ast_free(erds);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ static int enum_query_read(struct ast_channel *chan, const char *cmd, char *data
|
||||
snprintf(buf, len, "%u", erds->id);
|
||||
|
||||
if (!(datastore = ast_channel_datastore_alloc(&enum_result_datastore_info, buf))) {
|
||||
free(erds->context);
|
||||
free(erds);
|
||||
ast_free(erds->context);
|
||||
ast_free(erds);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user