diff options
author | V V <vvaltman@aurum> | 2015-10-12 13:50:22 +0300 |
---|---|---|
committer | V V <vvaltman@aurum> | 2015-10-12 13:50:22 +0300 |
commit | 790bde40a6f5b7db0ee842a3352b29bc7eff8082 (patch) | |
tree | 65f97eb4b45ef3d717d84786215e32e21767e82e /mtproto-client.c | |
parent | 6467a94ee3d9f69b6f23d66221f7bd0d58df7ac2 (diff) |
fixed couple of memory leaks
Diffstat (limited to 'mtproto-client.c')
-rw-r--r-- | mtproto-client.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mtproto-client.c b/mtproto-client.c index 338017c..8400239 100644 --- a/mtproto-client.c +++ b/mtproto-client.c @@ -1475,6 +1475,17 @@ void tgls_free_dc (struct tgl_state *TLS, struct tgl_dc *DC) { struct tgl_session *S = DC->sessions[0]; if (S) { tgls_free_session (TLS, S); } + + int i; + for (i = 0; i < 4; i++) { + struct tgl_dc_option *O = DC->options[i]; + while (O) { + struct tgl_dc_option *N = O->next; + tfree_str (O->ip); + tfree (O, sizeof (*O)); + O = N; + } + } if (DC->ev) { TLS->timer_methods->free (DC->ev); } tfree (DC, sizeof (*DC)); |