Commit b2056f63 authored by Wandenberg's avatar Wandenberg

fix #230 making the module compatible with nginx versions older than 1.7.3 again

parent 4aa2abdc
...@@ -313,10 +313,11 @@ ngx_http_push_stream_convert_char_to_msg_on_shared(ngx_http_push_stream_main_con ...@@ -313,10 +313,11 @@ ngx_http_push_stream_convert_char_to_msg_on_shared(ngx_http_push_stream_main_con
return NULL; return NULL;
} }
if ((msg->formatted_messages = ngx_slab_calloc(shpool, sizeof(ngx_str_t) * msg->qtd_templates)) == NULL) { if ((msg->formatted_messages = ngx_slab_alloc(shpool, sizeof(ngx_str_t) * msg->qtd_templates)) == NULL) {
ngx_http_push_stream_free_message_memory(shpool, msg); ngx_http_push_stream_free_message_memory(shpool, msg);
return NULL; return NULL;
} }
ngx_memzero(msg->formatted_messages, sizeof(ngx_str_t) * msg->qtd_templates);
for (q = ngx_queue_head(&mcf->msg_templates); q != ngx_queue_sentinel(&mcf->msg_templates); q = ngx_queue_next(q)) { for (q = ngx_queue_head(&mcf->msg_templates); q != ngx_queue_sentinel(&mcf->msg_templates); q = ngx_queue_next(q)) {
ngx_http_push_stream_template_t *cur = ngx_queue_data(q, ngx_http_push_stream_template_t, queue); ngx_http_push_stream_template_t *cur = ngx_queue_data(q, ngx_http_push_stream_template_t, queue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment