diff options
author | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-15 18:21:50 +0000 |
---|---|---|
committer | seanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-01-15 18:21:50 +0000 |
commit | adc69e041d2b415b3422672fb262423808dfa8ab (patch) | |
tree | ede1629dadd9e525779f3da8f54510a9dd1ea081 /main/features.c | |
parent | a79e0451bce168a451e7ed1e30226166e58e203c (diff) |
Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240368 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/features.c')
-rw-r--r-- | main/features.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/main/features.c b/main/features.c index 8ba195571..68f2f858a 100644 --- a/main/features.c +++ b/main/features.c @@ -1940,14 +1940,9 @@ static struct feature_group* register_group(const char *fgname) return NULL; } - if (!(fg = ast_calloc(1, sizeof(*fg)))) + if (!(fg = ast_calloc_with_stringfields(1, struct feature_group, 128))) return NULL; - if (ast_string_field_init(fg, 128)) { - ast_free(fg); - return NULL; - } - ast_string_field_set(fg, gname, fgname); AST_LIST_INSERT_HEAD(&feature_groups, fg, entry); @@ -1980,14 +1975,9 @@ static void register_group_feature(struct feature_group *fg, const char *exten, return; } - if (!(fge = ast_calloc(1, sizeof(*fge)))) + if (!(fge = ast_calloc_with_stringfields(1, struct feature_group_exten, 128))) return; - if (ast_string_field_init(fge, 128)) { - ast_free(fge); - return; - } - ast_string_field_set(fge, exten, S_OR(exten, feature->exten)); fge->feature = feature; |