mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 10:22:46 +00:00
Merge "endpoint snapshot: avoid second cleanup on alloc failure"
This commit is contained in:
@@ -464,7 +464,7 @@ static void endpoint_snapshot_dtor(void *obj)
|
|||||||
struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
|
struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
|
||||||
struct ast_endpoint *endpoint)
|
struct ast_endpoint *endpoint)
|
||||||
{
|
{
|
||||||
RAII_VAR(struct ast_endpoint_snapshot *, snapshot, NULL, ao2_cleanup);
|
struct ast_endpoint_snapshot *snapshot;
|
||||||
int channel_count;
|
int channel_count;
|
||||||
struct ao2_iterator i;
|
struct ao2_iterator i;
|
||||||
void *obj;
|
void *obj;
|
||||||
@@ -500,7 +500,6 @@ struct ast_endpoint_snapshot *ast_endpoint_snapshot_create(
|
|||||||
}
|
}
|
||||||
ao2_iterator_destroy(&i);
|
ao2_iterator_destroy(&i);
|
||||||
|
|
||||||
ao2_ref(snapshot, +1);
|
|
||||||
return snapshot;
|
return snapshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user