summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2010-01-15 18:21:50 +0000
committerSean Bright <sean@malleable.com>2010-01-15 18:21:50 +0000
commite612d87695ec794059dfe3fc0021bd11a331713d (patch)
treeede1629dadd9e525779f3da8f54510a9dd1ea081 /channels
parent89413e9ae2d8f0105758c5007313d60c540a8253 (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 'channels')
-rw-r--r--channels/chan_sip.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a3a84203e..a013937d4 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7859,17 +7859,11 @@ static int sip_register(const char *value, int lineno)
}
}
- if (!(reg = ast_calloc(1, sizeof(*reg)))) {
+ if (!(reg = ast_calloc_with_stringfields(1, struct sip_registry, 256))) {
ast_log(LOG_ERROR, "Out of memory. Can't allocate SIP registry entry\n");
return -1;
}
- if (ast_string_field_init(reg, 256)) {
- ast_log(LOG_ERROR, "Out of memory. Can't allocate SIP registry strings\n");
- ast_free(reg);
- return -1;
- }
-
ast_atomic_fetchadd_int(&regobjs, 1);
ASTOBJ_INIT(reg);
ast_string_field_set(reg, callback, ast_strip_quoted(S_OR(host2.extension, "s"), "\"", "\""));
@@ -7935,12 +7929,7 @@ static int sip_subscribe_mwi(const char *value, int lineno)
}
}
- if (!(mwi = ast_calloc(1, sizeof(*mwi)))) {
- return -1;
- }
-
- if (ast_string_field_init(mwi, 256)) {
- ast_free(mwi);
+ if (!(mwi = ast_calloc_with_stringfields(1, struct sip_subscription_mwi, 256))) {
return -1;
}