From 046ad88d886e73638d46b729bd23f68102425ba7 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 7 Oct 2010 11:21:20 +0200
Subject: [PATCH] crypt_init: use correct error define

---
 src/crypt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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 <simon@josefsson.org>
+/* Copyright (c) 2009, 2010 Simon Josefsson <simon@josefsson.org>
  * Copyright (c) 2004-2007, Sara Golemon <sarag@libssh2.org>
  * 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)) {