app_agent_pool.c: Fix off nominal ref leak.

Change-Id: Ib427ffc2c802620eaafb08b1c2a17dddd8fb8eb6
This commit is contained in:
Richard Mudgett
2018-04-02 16:49:38 -05:00
parent edba638a72
commit 6774913e82

View 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);