From a5bb6d40fb517aa175510ec179091e4f9ffaf6f6 Mon Sep 17 00:00:00 2001 From: Sven-Haegar Koch Date: Sat, 14 Apr 2012 02:29:32 +0200 Subject: [PATCH] sptps_stop(): clear pointers after free to avoid double free. sptps_stop() may get called twice on some failed connection setups. --- src/sptps.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sptps.c b/src/sptps.c index bdbfb89e..ff7c4168 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -576,9 +576,14 @@ bool sptps_stop(sptps_t *s) { // Clean up any resources. ecdh_free(&s->ecdh); free(s->inbuf); + s->inbuf = NULL; free(s->mykex); + s->mykex = NULL; free(s->hiskex); + s->hiskex = NULL; free(s->key); + s->key = NULL; free(s->label); + s->label = NULL; return true; } -- 2.39.5