Merged revisions 55555 via svnmerge from
authorJason Parker <jparker@digium.com>
Tue, 20 Feb 2007 16:56:58 +0000 (16:56 +0000)
committerJason Parker <jparker@digium.com>
Tue, 20 Feb 2007 16:56:58 +0000 (16:56 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55555 | qwell | 2007-02-20 10:53:45 -0600 (Tue, 20 Feb 2007) | 4 lines

No need to cast nor free with strdupa (thanks file)

55555!

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@55556 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_gtalk.c
channels/chan_jingle.c
res/res_jabber.c

index 23beb00..ad335d2 100644 (file)
@@ -258,10 +258,9 @@ static struct gtalk *find_gtalk(char *name, char *connection)
        struct gtalk *gtalk = NULL;
        char *domain = NULL , *s = NULL;
        if(strchr(connection, '@')) {
-               s = ast_strdupa((char *) connection);
+               s = ast_strdupa(connection);
                domain = strsep(&s, "@");
                ast_verbose("OOOOH domain = %s\n", domain);
-               free(s);
        }
        gtalk = ASTOBJ_CONTAINER_FIND(&gtalk_list, name);
        if (!gtalk && strchr(name, '@'))
@@ -876,13 +875,11 @@ static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const
        }
 
        if(strchr(tmp->us, '/')) {
-               data = ast_strdupa((char *) tmp->us);
+               data = ast_strdupa(tmp->us);
                exten = strsep(&data, "/");
        } else
                exten = tmp->us;
        ast_copy_string(tmp->exten,  exten, sizeof(tmp->exten));
-       if(data)
-               free(data);
        ast_mutex_init(&tmp->lock);
        ast_mutex_lock(&gtalklock);
        tmp->next = client->p;
@@ -1480,15 +1477,13 @@ static struct ast_channel *gtalk_request(const char *type, int format, void *dat
        struct ast_channel *chan = NULL;
 
        if (data) {
-               s = ast_strdupa((char *) data);
+               s = ast_strdupa(data);
                if (s) {
                        sender = strsep(&s, "/");
                        if (sender && (sender[0] != '\0'))
                                to = strsep(&s, "/");
                        if (!to) {
                                ast_log(LOG_ERROR, "Bad arguments in Gtalk Dialstring: %s\n", (char*) data);
-                               if (s)
-                                       free(s);
                                return NULL;
                        }
                }
@@ -1496,8 +1491,6 @@ static struct ast_channel *gtalk_request(const char *type, int format, void *dat
        client = find_gtalk(to, sender);
        if (!client) {
                ast_log(LOG_WARNING, "Could not find recipient.\n");
-               if (s)
-                       free(s);
                return NULL;
        }
        p = gtalk_alloc(client, strchr(sender, '@') ? sender : client->connection->jid->full, strchr(to, '@') ? to : client->user, NULL);
index b41e49b..2698064 100644 (file)
@@ -1360,15 +1360,13 @@ static struct ast_channel *jingle_request(const char *type, int format, void *da
        struct ast_channel *chan = NULL;
 
        if (data) {
-               s = ast_strdupa((char *) data);
+               s = ast_strdupa(data);
                if (s) {
                        sender = strsep(&s, "/");
                        if (sender && (sender[0] != '\0'))
                                to = strsep(&s, "/");
                        if (!to) {
                                ast_log(LOG_ERROR, "Bad arguments in Jingle Dialstring: %s\n", (char*) data);
-                               if (s)
-                                       free(s);
                                return NULL;
                        }
                }
@@ -1376,8 +1374,6 @@ static struct ast_channel *jingle_request(const char *type, int format, void *da
        client = find_jingle(to, sender);
        if (!client) {
                ast_log(LOG_WARNING, "Could not find recipient.\n");
-               if (s)
-                       free(s);
                return NULL;
        }
        p = jingle_alloc(client, to, NULL);
index 721398f..b47add7 100644 (file)
@@ -344,7 +344,7 @@ static int aji_status_exec(struct ast_channel *chan, void *data)
                ast_log(LOG_ERROR, "This application requires arguments.\n");
                return 0;
        }
-       s = ast_strdupa((char *) data);
+       s = ast_strdupa(data);
        if (s) {
                sender = strsep(&s, "|");
                if (sender && (sender[0] != '\0')) {
@@ -404,7 +404,7 @@ static int aji_send_exec(struct ast_channel *chan, void *data)
                ast_log(LOG_ERROR, "This application requires arguments.\n");
                return 0;
        }
-       s = ast_strdupa((char *) data);
+       s = ast_strdupa(data);
        if (s) {
                sender = strsep(&s, "|");
                if (sender && (sender[0] != '\0')) {