Skip to content

Commit

Permalink
1.12.4: Fix memory leaks and gcc compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitri Tikhonov committed Aug 27, 2018
1 parent 5f5d395 commit 6f126d8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/liblsquic/lsquic_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
7 changes: 7 additions & 0 deletions test/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions test/unittests/test_di_nocopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6f126d8

Please sign in to comment.