If a push is interrupted due to a timeout, c->c2.pulled_options_state is
never freed. Fix that by always cleaning up any remaining pulled
options state when we close a connection.
This changes the mbedtls implementation of md_ctx_cleanup to actually
clean up the context, which was not needed earlier.
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1516194984-1540-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg16265.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
... | ... |
@@ -3384,6 +3384,12 @@ do_close_tls(struct context *c) |
3384 | 3384 |
} |
3385 | 3385 |
c->c2.options_string_local = c->c2.options_string_remote = NULL; |
3386 | 3386 |
#endif |
3387 |
+ |
|
3388 |
+ if (c->c2.pulled_options_state) |
|
3389 |
+ { |
|
3390 |
+ md_ctx_cleanup(c->c2.pulled_options_state); |
|
3391 |
+ md_ctx_free(c->c2.pulled_options_state); |
|
3392 |
+ } |
|
3387 | 3393 |
} |
3388 | 3394 |
|
3389 | 3395 |
/* |