]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Make sure that the string we set will survive the unref of
authorMark Michelson <mmichelson@digium.com>
Wed, 4 Jun 2008 22:05:33 +0000 (22:05 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 4 Jun 2008 22:05:33 +0000 (22:05 +0000)
the queue member.

Thanks to Russell, who pointed this out.

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

apps/app_queue.c

index 18b2cd9f9d2a6b0aba2c30f0ed8e67f64cc3f166..01fdcf3aa9b278253c5137246c8f5dbfc4055378 100644 (file)
@@ -4815,9 +4815,9 @@ static char *complete_queue_remove_member(const char *line, const char *word, in
                                if (++which > state) {
                                        char *tmp;
                                        ast_mutex_unlock(&q->lock);
-                                       tmp = m->interface;
+                                       tmp = ast_strdup(m->interface);
                                        ao2_ref(m, -1);
-                                       return ast_strdup(tmp);
+                                       return tmp;
                                }
                                ao2_ref(m, -1);
                        }