summaryrefslogtreecommitdiff
path: root/res/res_phoneprov.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_phoneprov.c')
-rw-r--r--res/res_phoneprov.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c
index 49fdbf870..ff3046bf5 100644
--- a/res/res_phoneprov.c
+++ b/res/res_phoneprov.c
@@ -636,12 +636,7 @@ static void build_profile(const char *name, struct ast_variable *v)
AST_APP_ARG(mimetype);
);
- if (!(pp_file = ast_calloc(1, sizeof(*pp_file)))) {
- profile = unref_profile(profile);
- return;
- }
- if (ast_string_field_init(pp_file, 32)) {
- ast_free(pp_file);
+ if (!(pp_file = ast_calloc_with_stringfields(1, struct phoneprov_file, 32))) {
profile = unref_profile(profile);
return;
}
@@ -712,13 +707,7 @@ static struct extension *build_extension(struct ast_config *cfg, const char *nam
const char *tmp;
int i;
- if (!(exten = ast_calloc(1, sizeof(*exten)))) {
- return NULL;
- }
-
- if (ast_string_field_init(exten, 32)) {
- ast_free(exten);
- exten = NULL;
+ if (!(exten = ast_calloc_with_stringfields(1, struct extension, 32))) {
return NULL;
}