projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leaks found by valgrind.
[tinc]
/
src
/
sptps.c
diff --git
a/src/sptps.c
b/src/sptps.c
index
10d6e04
..
ed1d952
100644
(file)
--- a/
src/sptps.c
+++ b/
src/sptps.c
@@
-627,18
+627,17
@@
bool sptps_start(sptps_t *s, void *handle, bool initiator, bool datagram, ecdsa_
// Stop a SPTPS session.
bool sptps_stop(sptps_t *s) {
// Clean up any resources.
// Stop a SPTPS session.
bool sptps_stop(sptps_t *s) {
// Clean up any resources.
+ cipher_close(&s->incipher);
+ cipher_close(&s->outcipher);
+ digest_close(&s->indigest);
+ digest_close(&s->outdigest);
ecdh_free(&s->ecdh);
free(s->inbuf);
ecdh_free(&s->ecdh);
free(s->inbuf);
- s->inbuf = NULL;
free(s->mykex);
free(s->mykex);
- s->mykex = NULL;
free(s->hiskex);
free(s->hiskex);
- s->hiskex = NULL;
free(s->key);
free(s->key);
- s->key = NULL;
free(s->label);
free(s->label);
- s->label = NULL;
free(s->late);
free(s->late);
-
s->late = NULL
;
+
memset(s, 0, sizeof *s)
;
return true;
}
return true;
}