Don't free() an astobj2 object.
authorRussell Bryant <russell@russellbryant.com>
Tue, 31 Mar 2009 14:53:45 +0000 (14:53 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 31 Mar 2009 14:53:45 +0000 (14:53 +0000)
(closes issue #14672)
Reported by: makoto

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

apps/app_queue.c

index 1acf5bb..b3dd532 100644 (file)
@@ -1630,7 +1630,7 @@ static struct call_queue *alloc_queue(const char *queuename)
 
        if ((q = ao2_alloc(sizeof(*q), destroy_queue))) {
                if (ast_string_field_init(q, 64)) {
-                       free(q);
+                       ao2_ref(q, -1);
                        return NULL;
                }
                ast_string_field_set(q, name, queuename);