mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
pbx.c: On error, ast_add_extension2_lockopt should always free 'data'
In the event that the desired extension already exists, ast_add_extension2_lockopt() will free the 'data' it is passed before returning an error, so we should not be freeing it ourselves. Additionally, there were two places where ast_add_extension2_lockopt() could return an error without also freeing the 'data' pointer, so we add that. ASTERISK-29097 #close Change-Id: I904707aae55169feda050a5ed7c6793b53fe6eae
This commit is contained in:
committed by
Friendly Automation
parent
773f424c7f
commit
51cba591e3
@@ -475,7 +475,6 @@ static int add_extension(struct ast_context *context, const char *exten,
|
||||
|
||||
if (ast_add_extension2_nolock(context, 0, exten, priority, NULL, NULL,
|
||||
app, data, free_ptr, BASE_REGISTRAR, NULL, 0)) {
|
||||
ast_free(data);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user