]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app_agent_pool.c: Fix off nominal ref leak.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 2 Apr 2018 21:49:38 +0000 (16:49 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 4 Apr 2018 23:02:48 +0000 (17:02 -0600)
Change-Id: Ib427ffc2c802620eaafb08b1c2a17dddd8fb8eb6

apps/app_agent_pool.c

index 3c2ea38706b547c4512cff27a22f735c47675595..805c403f5d6b342fb9328b33edabba4fc9b0bd47 100644 (file)
@@ -438,6 +438,7 @@ static void *agent_cfg_alloc(const char *name)
        cfg = ao2_alloc_options(sizeof(*cfg), agent_cfg_destructor,
                AO2_ALLOC_OPT_LOCK_NOLOCK);
        if (!cfg || ast_string_field_init(cfg, 64)) {
+               ao2_cleanup(cfg);
                return NULL;
        }
        ast_string_field_set(cfg, username, name);