mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
Fix crash caused by unloading or reloading of res_http_post
When unlinking itself from the registered HTTP URIs, res_http_post could inadvertently free all URIs registered with the HTTP server. This patch modifies the unregister method to only free the URI that is actually being unregistered, as opposed to all of them. ........ Merged revisions 361803 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361804 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -581,7 +581,6 @@ void ast_http_uri_unlink_all_with_key(const char *key)
|
|||||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&uris, urih, entry) {
|
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&uris, urih, entry) {
|
||||||
if (!strcmp(urih->key, key)) {
|
if (!strcmp(urih->key, key)) {
|
||||||
AST_RWLIST_REMOVE_CURRENT(entry);
|
AST_RWLIST_REMOVE_CURRENT(entry);
|
||||||
}
|
|
||||||
if (urih->dmallocd) {
|
if (urih->dmallocd) {
|
||||||
ast_free(urih->data);
|
ast_free(urih->data);
|
||||||
}
|
}
|
||||||
@@ -589,6 +588,7 @@ void ast_http_uri_unlink_all_with_key(const char *key)
|
|||||||
ast_free(urih);
|
ast_free(urih);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
AST_RWLIST_TRAVERSE_SAFE_END;
|
AST_RWLIST_TRAVERSE_SAFE_END;
|
||||||
AST_RWLIST_UNLOCK(&uris);
|
AST_RWLIST_UNLOCK(&uris);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user