mirror of
https://github.com/asterisk/asterisk.git
synced 2026-06-02 17:25:35 +00:00
app_mixmonitor.c: Fix crash in mixmonitor_ds_remove_and_free when datastore is NULL
The datastore may be NULL, so a null pointer check needs to be added. Resolves: #1673
This commit is contained in:
committed by
github-actions[bot]
parent
55e403fa8b
commit
f91f7d580d
@@ -1064,12 +1064,10 @@ static void mixmonitor_ds_remove_and_free(struct ast_channel *chan, const char *
|
||||
|
||||
datastore = ast_channel_datastore_find(chan, &mixmonitor_ds_info, datastore_id);
|
||||
|
||||
/*
|
||||
* Currently the one place this function is called from guarantees a
|
||||
* datastore is present, thus return checks can be avoided here.
|
||||
*/
|
||||
ast_channel_datastore_remove(chan, datastore);
|
||||
ast_datastore_free(datastore);
|
||||
if (datastore) {
|
||||
ast_channel_datastore_remove(chan, datastore);
|
||||
ast_datastore_free(datastore);
|
||||
}
|
||||
|
||||
ast_channel_unlock(chan);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user