diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 23:01:01 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 23:01:01 +0000 |
commit | 7a0fe5c93f93c827215ac7ed613130434c77e649 (patch) | |
tree | ca14014e3c226332296ae0d687f996e9d8dfe6b2 /channels | |
parent | e95289a0e951770a0233260e49add9df9b20d97a (diff) |
Convert uses of strdup() to ast_strdup()
(issue #9983, eliel)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69436 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_h323.c | 12 | ||||
-rw-r--r-- | channels/chan_misdn.c | 24 | ||||
-rw-r--r-- | channels/chan_vpb.cc | 8 | ||||
-rw-r--r-- | channels/iax2-provision.c | 2 |
4 files changed, 23 insertions, 23 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 85c912b32..8291316f2 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -536,7 +536,7 @@ static int oh323_digit_begin(struct ast_channel *c, char digit) ast_log(LOG_DTMF, "Begin sending inband digit %c on %s\n", digit, c->name); } pvt->txDtmfDigit = digit; - token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL; + token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL; ast_mutex_unlock(&pvt->lock); h323_send_tone(token, digit); if (token) { @@ -575,7 +575,7 @@ static int oh323_digit_end(struct ast_channel *c, char digit, unsigned int durat ast_log(LOG_DTMF, "End sending inband digit %c on %s, duration %d\n", digit, c->name, duration); } pvt->txDtmfDigit = ' '; - token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL; + token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL; ast_mutex_unlock(&pvt->lock); h323_send_tone(token, ' '); if (token) { @@ -680,7 +680,7 @@ static int oh323_answer(struct ast_channel *c) ast_debug(1, "Answering on %s\n", c->name); ast_mutex_lock(&pvt->lock); - token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL; + token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL; ast_mutex_unlock(&pvt->lock); res = h323_answering_call(token, 0); if (token) @@ -739,7 +739,7 @@ static int oh323_hangup(struct ast_channel *c) /* Start the process if it's not already started */ if (!pvt->alreadygone && !pvt->hangupcause) { - call_token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL; + call_token = pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL; if (call_token) { /* Release lock to eliminate deadlock */ ast_mutex_unlock(&pvt->lock); @@ -877,7 +877,7 @@ static int oh323_indicate(struct ast_channel *c, int condition, const void *data int got_progress; ast_mutex_lock(&pvt->lock); - token = (pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL); + token = (pvt->cd.call_token ? ast_strdup(pvt->cd.call_token) : NULL); got_progress = pvt->got_progress; if (condition == AST_CONTROL_PROGRESS) pvt->got_progress = 1; @@ -1092,7 +1092,7 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c ch->cid.cid_ton = pvt->cd.type_of_number; if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) { - ch->cid.cid_dnid = strdup(pvt->exten); + ch->cid.cid_dnid = ast_strdup(pvt->exten); } if (pvt->cd.transfer_capability >= 0) ch->transfercapability = pvt->cd.transfer_capability; diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index e74972aa4..f8f671421 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -1409,7 +1409,7 @@ static char *complete_ch_helper(const char *line, const char *word, int pos, int ast_mutex_unlock(&c->lock); } if (c) { - ret = strdup(c->name); + ret = ast_strdup(c->name); ast_mutex_unlock(&c->lock); } else ret = NULL; @@ -1429,13 +1429,13 @@ static char *complete_debug_port (const char *line, const char *word, int pos, i switch (pos) { case 4: if (*word == 'p') - return strdup("port"); + return ast_strdup("port"); else if (*word == 'o') - return strdup("only"); + return ast_strdup("only"); break; case 6: if (*word == 'o') - return strdup("only"); + return ast_strdup("only"); break; } return NULL; @@ -1452,15 +1452,15 @@ static char *complete_show_config (const char *line, const char *word, int pos, switch (pos) { case 3: if ((!strncmp(word, "description", wordlen)) && (++which > state)) - return strdup("description"); + return ast_strdup("description"); if ((!strncmp(word, "descriptions", wordlen)) && (++which > state)) - return strdup("descriptions"); + return ast_strdup("descriptions"); if ((!strncmp(word, "0", wordlen)) && (++which > state)) - return strdup("0"); + return ast_strdup("0"); while ((port = misdn_cfg_get_next_port(port)) != -1) { snprintf(buffer, sizeof(buffer), "%d", port); if ((!strncmp(word, buffer, wordlen)) && (++which > state)) { - return strdup(buffer); + return ast_strdup(buffer); } } break; @@ -1472,14 +1472,14 @@ static char *complete_show_config (const char *line, const char *word, int pos, misdn_cfg_get_name(elem, buffer, sizeof(buffer)); if (!wordlen || !strncmp(word, buffer, wordlen)) { if (++which > state) - return strdup(buffer); + return ast_strdup(buffer); } } } else if (strstr(line, "descriptions ")) { if ((!wordlen || !strncmp(word, "general", wordlen)) && (++which > state)) - return strdup("general"); + return ast_strdup("general"); if ((!wordlen || !strncmp(word, "ports", wordlen)) && (++which > state)) - return strdup("ports"); + return ast_strdup("ports"); } break; } @@ -1895,7 +1895,7 @@ static int read_config(struct chan_list *ch, int orig) if ( !ast_strlen_zero(bc->rad) ) { if (ast->cid.cid_rdnis) ast_free(ast->cid.cid_rdnis); - ast->cid.cid_rdnis = strdup(bc->rad); + ast->cid.cid_rdnis = ast_strdup(bc->rad); } misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial)); diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc index a89701a6a..8e38409e5 100644 --- a/channels/chan_vpb.cc +++ b/channels/chan_vpb.cc @@ -688,8 +688,8 @@ static void get_callerid(struct vpb_pvt *p) if (cli_struct->ra_cldn[0]=='\0'){ /* - owner->cid.cid_num = strdup(cli_struct->cldn); - owner->cid.cid_name = strdup(cli_struct->cn); + owner->cid.cid_num = ast_strdup(cli_struct->cldn); + owner->cid.cid_name = ast_strdup(cli_struct->cn); */ if (owner){ ast_set_callerid(owner, cli_struct->cldn, cli_struct->cn, cli_struct->cldn); @@ -2694,7 +2694,7 @@ static struct ast_channel *vpb_request(const char *type, int format, void *data, int oldformat; struct vpb_pvt *p; struct ast_channel *tmp = NULL; - char *name = strdup(data ? (char *)data : ""); + char *name = ast_strdup(data ? (char *)data : ""); char *s, *sepstr; int group=-1; @@ -2940,7 +2940,7 @@ int load_module() } else if (strcasecmp(v->name, "language") == 0) { strncpy(language, v->value, sizeof(language)-1); } else if (strcasecmp(v->name, "callerid") == 0) { - callerid = strdup(v->value); + callerid = ast_strdup(v->value); } else if (strcasecmp(v->name, "mode") == 0) { if (strncasecmp(v->value, "di", 2) == 0) mode = MODE_DIALTONE; diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c index 4c5727967..962e6d958 100644 --- a/channels/iax2-provision.c +++ b/channels/iax2-provision.c @@ -169,7 +169,7 @@ char *iax_prov_complete_template(const char *line, const char *word, int pos, in ast_mutex_lock(&provlock); for (c = templates; c; c = c->next) { if (!strncasecmp(word, c->name, wordlen) && ++which > state) { - ret = strdup(c->name); + ret = ast_strdup(c->name); break; } } |