summaryrefslogtreecommitdiff
path: root/main/endpoints.c
diff options
context:
space:
mode:
authorScott Griepentrog <scott@griepentrog.com>2015-09-04 09:26:46 -0500
committerScott Griepentrog <scott@griepentrog.com>2015-09-04 09:26:46 -0500
commit7691035312ee649b4d949cace139eddb6e6e49b6 (patch)
tree232624a0f4bc6e93d75544472713ea2099735de9 /main/endpoints.c
parentc15d8cc0ed110ace9e85cce0857524358139c075 (diff)
endpoint snapshot: avoid second cleanup on alloc failure
In ast_endpoint_snapshot_create(), a failure to init the string fields results in two attempts to ao2_cleanup the same pointer. Removed RAII_VAR to eliminate problem. ASTERISK-25375 #close Reported by: Scott Griepentrog Change-Id: If4d9dfb1bbe3836b623642ec690b6d49b25e8979
Diffstat (limited to 'main/endpoints.c')
-rw-r--r--main/endpoints.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/main/endpoints.c b/main/endpoints.c
index df9d289c7..21326561c 100644
--- a/main/endpoints.c
+++ b/main/endpoints.c
@@ -464,7 +464,7 @@ static void endpoint_snapshot_dtor(void *obj)
struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
struct ast_endpoint *endpoint)
{
- RAII_VAR(struct ast_endpoint_snapshot *, snapshot, NULL, ao2_cleanup);
+ struct ast_endpoint_snapshot *snapshot;
int channel_count;
struct ao2_iterator i;
void *obj;
@@ -500,7 +500,6 @@ struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
}
ao2_iterator_destroy(&i);
- ao2_ref(snapshot, +1);
return snapshot;
}