sptps_stop(): clear pointers after free to avoid double free.

sptps_stop() may get called twice on some failed connection setups.
This commit is contained in:
Sven-Haegar Koch 2012-04-14 02:29:32 +02:00 committed by Guus Sliepen
parent 1d9dacb1f2
commit a5bb6d40fb

View file

@ -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;
}