diff --git a/main/http.c b/main/http.c index c7e3ceb15a..5bbeca33ee 100644 --- a/main/http.c +++ b/main/http.c @@ -581,12 +581,12 @@ 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); - } - if (urih->mallocd) { - ast_free(urih); + if (urih->dmallocd) { + ast_free(urih->data); + } + if (urih->mallocd) { + ast_free(urih); + } } } AST_RWLIST_TRAVERSE_SAFE_END;