Commit 2edda444 authored by David Goulet's avatar David Goulet 🆘
Browse files

test: Missing tor_free() in metrics unit tests



Found by coverity:

  *** CID 1468664:  Resource leaks  (RESOURCE_LEAK)
  /src/test/test_metrics.c: 83 in test_config()
  77       tt_int_op(ret, OP_EQ, false);
  78
  79      done:
  80       SMARTLIST_FOREACH(ports, port_cfg_t *, c, port_cfg_free(c));
  81       smartlist_free(ports);
  82       or_options_free(options);
  >>>     CID 1468664:  Resource leaks  (RESOURCE_LEAK)
  >>>     Variable "err_msg" going out of scope leaks the storage it points to.
  83     }
  84
  85     static char _c_buf[256];
  86     #define CONTAINS(conn, msg) \
  87       do { \
  88         tt_int_op(buf_datalen(conn->outbuf), OP_EQ, (strlen(msg))); \
Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
parent 362229f1
......@@ -80,6 +80,7 @@ test_config(void *arg)
SMARTLIST_FOREACH(ports, port_cfg_t *, c, port_cfg_free(c));
smartlist_free(ports);
or_options_free(options);
tor_free(err_msg);
}
static char _c_buf[256];
......
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