projects
/
oweals
/
tinc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d9dacb
)
sptps_stop(): clear pointers after free to avoid double free.
author
Sven-Haegar Koch
<haegar@sdinet.de>
Sat, 14 Apr 2012 00:29:32 +0000
(
02:29
+0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 14 Apr 2012 23:10:49 +0000
(
01:10
+0200)
sptps_stop() may get called twice on some failed connection setups.
src/sptps.c
patch
|
blob
|
history
diff --git
a/src/sptps.c
b/src/sptps.c
index bdbfb89e61d7de3a64579f67b93c0b4582b5b1d9..ff7c4168e0410b3564ceb32e74fce0da780b4f4a 100644
(file)
--- 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;
}