]> 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:12 +0000 (18:02 -0500)
Change-Id: Ib427ffc2c802620eaafb08b1c2a17dddd8fb8eb6

apps/app_agent_pool.c

index ef8b95ec8be074f9277a2dcef6081d9f5e6c20bc..07040f6c59fc2760669216d55f2710807a08dda4 100644 (file)
@@ -440,6 +440,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);