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