X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgc-libgcrypt.c;h=a9e6279a2a690b12f674ee3affa49ea806a17878;hb=595fe7f463f7fb72ad6acc58d885585590f8f285;hp=bc0d12bbaf6b16aae69cafde317effe89dba9252;hpb=c5d8261e0e5c4675b6238af2f25cad968b94d8c8;p=gnulib.git diff --git a/lib/gc-libgcrypt.c b/lib/gc-libgcrypt.c index bc0d12bba..a9e6279a2 100644 --- a/lib/gc-libgcrypt.c +++ b/lib/gc-libgcrypt.c @@ -1,5 +1,5 @@ /* gc-libgcrypt.c --- Crypto wrappers around Libgcrypt for GC. - * Copyright (C) 2002, 2003, 2004, 2005 Simon Josefsson + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Simon Josefsson * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published @@ -65,6 +65,8 @@ gc_done (void) return; } +#ifdef GC_USE_RANDOM + /* Randomness. */ Gc_rc @@ -88,6 +90,8 @@ gc_random (char *data, size_t datalen) return GC_OK; } +#endif + /* Memory allocation. */ void @@ -243,6 +247,8 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle) Gc_rc rc = GC_OK; ctx = calloc (sizeof (*ctx), 1); + if (!ctx) + return GC_MALLOC_ERROR; ctx->alg = hash; ctx->mode = mode;