diff --git a/src/crypt.c b/src/crypt.c index 34f3cde..759ec15 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009 Simon Josefsson +/* Copyright (c) 2009, 2010 Simon Josefsson * Copyright (c) 2004-2007, Sara Golemon * All rights reserved. * @@ -79,9 +79,9 @@ crypt_init(LIBSSH2_SESSION * session, { struct crypt_ctx *ctx = LIBSSH2_ALLOC(session, sizeof(struct crypt_ctx)); - if (!ctx) { - return -1; - } + if (!ctx) + return LIBSSH2_ERROR_ALLOC; + ctx->encrypt = encrypt; ctx->algo = method->algo; if (_libssh2_cipher_init(&ctx->h, ctx->algo, iv, secret, encrypt)) {