diff options
Diffstat (limited to 'src/libcrypto.c')
-rw-r--r-- | src/libcrypto.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcrypto.c b/src/libcrypto.c index 84afbb09..479c8c18 100644 --- a/src/libcrypto.c +++ b/src/libcrypto.c @@ -250,7 +250,11 @@ void md5_final(unsigned char *md, MD5CTX c) { } ssh_mac_ctx ssh_mac_ctx_init(enum ssh_mac_e type){ - ssh_mac_ctx ctx=malloc(sizeof(struct ssh_mac_ctx_struct)); + ssh_mac_ctx ctx = malloc(sizeof(struct ssh_mac_ctx_struct)); + if (ctx == NULL) { + return NULL; + } + ctx->mac_type=type; switch(type){ case SSH_MAC_SHA1: |