1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

pki_gcrypt: Fix memory leak.

* src/pki_gcrypt.c (pki_key_ecdsa_to_nid): Release 'sexp'.

Signed-off-by: Justus Winter <justus@g10code.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Justus Winter
2016-11-09 16:34:14 +01:00
committed by Andreas Schneider
parent 2f6a866373
commit 4b33c6bb97

View File

@@ -701,20 +701,24 @@ static int pki_key_ecdsa_to_nid(gcry_sexp_t k)
cmp = memcmp("NIST P-256", tmp, size);
if (cmp == 0) {
gcry_sexp_release(sexp);
return NID_gcrypt_nistp256;
}
cmp = memcmp("NIST P-384", tmp, size);
if (cmp == 0) {
gcry_sexp_release(sexp);
return NID_gcrypt_nistp384;
}
cmp = memcmp("NIST P-521", tmp, size);
if (cmp == 0) {
gcry_sexp_release(sexp);
return NID_gcrypt_nistp521;
}
}
gcry_sexp_release(sexp);
return -1;
}