logeventf(ssh, "Initialised %s decompression",
ssh->sccomp->text_name);
freebn(s->f);
- freebn(s->g);
freebn(s->K);
- freebn(s->p);
+ if (ssh->kex == &ssh_diffiehellman_gex) {
+ freebn(s->g);
+ freebn(s->p);
+ }
/*
* If this is the first key exchange phase, we must pass the