1.12.4: Fix memory leaks and gcc compilation warnings

This commit is contained in:
Dmitri Tikhonov 2018-08-27 13:55:06 -04:00
parent 5f5d395b59
commit 6f126d809b
5 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2018-08-27
- 1.12.4
- Fix memory leak when engine is destroyed
- Fix memory leak in http_client
- Fix gcc warning in unit tests
2018-08-22
- 1.12.3

View File

@ -25,7 +25,7 @@ extern "C" {
#define LSQUIC_MAJOR_VERSION 1
#define LSQUIC_MINOR_VERSION 12
#define LSQUIC_PATCH_VERSION 3
#define LSQUIC_PATCH_VERSION 4
/**
* Engine flags:

View File

@ -574,6 +574,7 @@ lsquic_engine_destroy (lsquic_engine_t *engine)
assert(0 == lsquic_mh_count(&engine->conns_out));
assert(0 == lsquic_mh_count(&engine->conns_tickable));
lsquic_mm_cleanup(&engine->pub.enp_mm);
free(engine->conns_tickable.mh_elems);
free(engine);
}

View File

@ -306,6 +306,7 @@ display_cert_chain (lsquic_conn_t *conn)
name = X509_get_subject_name(cert);
LSQ_INFO("cert #%u: name: %s", i,
X509_NAME_oneline(name, buf, sizeof(buf)));
X509_free(cert);
}
sk_X509_free(chain);
@ -712,5 +713,11 @@ main (int argc, char **argv)
if (promise_fd >= 0)
(void) close(promise_fd);
while ((pe = TAILQ_FIRST(&client_ctx.hcc_path_elems)))
{
TAILQ_REMOVE(&client_ctx.hcc_path_elems, pe, next_pe);
free(pe);
}
exit(0 == s ? EXIT_SUCCESS : EXIT_FAILURE);
}

View File

@ -281,8 +281,8 @@ run_di_nocopy_test (const struct nocopy_test *test)
{
data_frame = di->di_if->di_get_frame(di, nread);
assert(data_frame); /* Self-check */
n_to_read = test->read_until - nread > data_frame->df_size - data_frame->df_read_off
? data_frame->df_size - data_frame->df_read_off : test->read_until - nread;
n_to_read = test->read_until - nread > (unsigned) data_frame->df_size - data_frame->df_read_off
? (unsigned) data_frame->df_size - data_frame->df_read_off : test->read_until - nread;
data_frame->df_read_off += n_to_read;
nread += n_to_read;
if (data_frame->df_read_off == data_frame->df_size)