]> git.meshlink.io Git - meshlink/commitdiff
free_connection_partially(): Avoid possible use-after-free for c->hischallenge
authorSven-Haegar Koch <haegar@sdinet.de>
Fri, 20 Apr 2012 23:59:01 +0000 (01:59 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 8 May 2012 14:18:18 +0000 (16:18 +0200)
src/connection.c

index dd5244860bfea4df1ff31d0f8cb9711b8409f027..6fdd2bc4c5e413efba8e178a14a847b53db70c4f 100644 (file)
@@ -64,8 +64,10 @@ void free_connection_partially(connection_t *c) {
        ecdsa_free(&c->ecdsa);
        rsa_free(&c->rsa);
 
-       if(c->hischallenge)
+       if(c->hischallenge) {
                free(c->hischallenge);
+               c->hischallenge = NULL;
+       }
 
        buffer_clear(&c->inbuf);
        buffer_clear(&c->outbuf);