Commit 6a51af9e authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Fix a bug in mg_mgr_init_opt with opts.num_ifaces

h/t @YankunLi

Closes https://github.com/cesanta/mongoose/pull/939

CL: mg: Fix a bug in mg_mgr_init_opt with opts.num_ifaces

PUBLISHED_FROM=a87518b3505429a3cf9cd6d84b3b781e7dbdcfd5
parent 9d73b347
......@@ -2514,7 +2514,7 @@ void mg_mgr_init_opt(struct mg_mgr *m, void *user_data,
m->num_ifaces = opts.num_ifaces;
m->ifaces =
(struct mg_iface **) MG_MALLOC(sizeof(*m->ifaces) * opts.num_ifaces);
for (i = 0; i < mg_num_ifaces; i++) {
for (i = 0; i < opts.num_ifaces; i++) {
m->ifaces[i] = mg_if_create_iface(opts.ifaces[i], m);
m->ifaces[i]->vtable->init(m->ifaces[i]);
}
......
......@@ -224,7 +224,7 @@ void mg_mgr_init_opt(struct mg_mgr *m, void *user_data,
m->num_ifaces = opts.num_ifaces;
m->ifaces =
(struct mg_iface **) MG_MALLOC(sizeof(*m->ifaces) * opts.num_ifaces);
for (i = 0; i < mg_num_ifaces; i++) {
for (i = 0; i < opts.num_ifaces; i++) {
m->ifaces[i] = mg_if_create_iface(opts.ifaces[i], m);
m->ifaces[i]->vtable->init(m->ifaces[i]);
}
......
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