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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@361803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.15
Matthew Jordan 14 years ago
parent c359eeb9c6
commit 40beb62845

@ -582,7 +582,6 @@ void ast_http_uri_unlink_all_with_key(const char *key)
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&uris, urih, entry) {
if (!strcmp(urih->key, key)) {
AST_RWLIST_REMOVE_CURRENT(entry);
}
if (urih->dmallocd) {
ast_free(urih->data);
}
@ -590,6 +589,7 @@ void ast_http_uri_unlink_all_with_key(const char *key)
ast_free(urih);
}
}
}
AST_RWLIST_TRAVERSE_SAFE_END;
AST_RWLIST_UNLOCK(&uris);
}

Loading…
Cancel
Save