diff options
author | Sean Bright <sean@malleable.com> | 2010-01-15 18:21:50 +0000 |
---|---|---|
committer | Sean Bright <sean@malleable.com> | 2010-01-15 18:21:50 +0000 |
commit | e612d87695ec794059dfe3fc0021bd11a331713d (patch) | |
tree | ede1629dadd9e525779f3da8f54510a9dd1ea081 /res | |
parent | 89413e9ae2d8f0105758c5007313d60c540a8253 (diff) |
Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_phoneprov.c | 15 | ||||
-rw-r--r-- | res/res_smdi.c | 7 |
2 files changed, 3 insertions, 19 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; } diff --git a/res/res_smdi.c b/res/res_smdi.c index 3cb7fa32a..c59bd4afa 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -848,13 +848,8 @@ static void append_mailbox_mapping(struct ast_variable *var, struct ast_smdi_int struct mailbox_mapping *mm; char *mailbox, *context; - if (!(mm = ast_calloc(1, sizeof(*mm)))) + if (!(mm = ast_calloc_with_stringfields(1, struct mailbox_mapping, 32))) return; - - if (ast_string_field_init(mm, 32)) { - free(mm); - return; - } ast_string_field_set(mm, smdi, var->name); |