Commit d79f986d authored by Geoff Simmons's avatar Geoff Simmons

Fix an uninitialized loop counter and possible memory leak in MQ/ActiveMQ

parent cd6e06e7
......@@ -192,11 +192,13 @@ MQ_WorkerShutdown(void **priv)
const char *
MQ_GlobalShutdown(void)
{
const char *err;
for (int i; i < n_uris; i++)
if (connections[i] != NULL
&& (err = AMQ_ConnectionShutdown(connections[i])) != NULL)
return err;
if (n_uris > 0) {
const char *err;
for (int i = 0; i < n_uris; i++)
if (connections[i] != NULL
&& (err = AMQ_ConnectionShutdown(connections[i])) != NULL)
return err;
free(connections);
}
return AMQ_GlobalShutdown();
}
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