updates.
[silc.git] / apps / silcd / protocol.c
index ecca5e688776ec5ea88428671ba5056370218227..ad86e001293603e345f9931b3bab9928a28dc100 100644 (file)
@@ -367,9 +367,12 @@ SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
                                            ctx->responder)) {
        protocol->state = SILC_PROTOCOL_STATE_ERROR;
        protocol->execute(server->timeout_queue, 0, protocol, fd, 0, 300000);
+       silc_ske_free_key_material(keymat);
        return;
       }
 
+      silc_ske_free_key_material(keymat);
+
       /* Unregister the timeout task since the protocol has ended. 
         This was the timeout task to be executed if the protocol is
         not completed fast enough. */