Skip to content
Permalink
Browse files

Fixed _libssh2_rsa_sha1_sign memory leak.

  • Loading branch information...
apccurtiss committed May 15, 2019
1 parent 1130615 commit 2b01fd80ef65e34a4ce6f80fcad6513f47d771f3
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/libgcrypt.c
@@ -400,6 +400,7 @@ _libssh2_rsa_sha1_sign(LIBSSH2_SESSION * session,

tmp = gcry_sexp_nth_data(data, 1, &size);
if(!tmp) {
gcry_sexp_release(data);
return -1;
}

@@ -410,11 +411,14 @@ _libssh2_rsa_sha1_sign(LIBSSH2_SESSION * session,

*signature = LIBSSH2_ALLOC(session, size);
if(!*signature) {
gcry_sexp_release(data);
return -1;
}
memcpy(*signature, tmp, size);
*signature_len = size;

gcry_sexp_release(data);

return rc;
}

0 comments on commit 2b01fd8

Please sign in to comment.
You can’t perform that action at this time.