Skip to content

Commit

Permalink
Fixed _libssh2_rsa_sha1_sign memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
apccurtiss committed May 15, 2019
1 parent 1130615 commit 2b01fd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libgcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 2b01fd8

Please sign in to comment.