mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +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:
12
main/enum.c
12
main/enum.c
@@ -443,7 +443,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds
|
||||
}
|
||||
|
||||
if (chan && ast_autoservice_start(chan) < 0) {
|
||||
free(context);
|
||||
ast_free(context);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -523,11 +523,11 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds
|
||||
|
||||
if (!argcontext) {
|
||||
for (k = 0; k < context->naptr_rrs_count; k++) {
|
||||
free(context->naptr_rrs[k].result);
|
||||
free(context->naptr_rrs[k].tech);
|
||||
ast_free(context->naptr_rrs[k].result);
|
||||
ast_free(context->naptr_rrs[k].tech);
|
||||
}
|
||||
free(context->naptr_rrs);
|
||||
free(context);
|
||||
ast_free(context->naptr_rrs);
|
||||
ast_free(context);
|
||||
} else
|
||||
*argcontext = context;
|
||||
|
||||
@@ -622,7 +622,7 @@ int ast_enum_init(void)
|
||||
while (s) {
|
||||
sl = s;
|
||||
s = s->next;
|
||||
free(sl);
|
||||
ast_free(sl);
|
||||
}
|
||||
toplevs = NULL;
|
||||
cfg = ast_config_load("enum.conf");
|
||||
|
Reference in New Issue
Block a user