From: Andre Noll Date: Mon, 15 Aug 2011 18:09:54 +0000 (+0200) Subject: crypt: Really set result to NULL if get_asymmetric_key() fails. X-Git-Tag: v0.4.8~6 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=c6991cf20bdfe7426e536f7020a0ff741df84dee crypt: Really set result to NULL if get_asymmetric_key() fails. The error path of this function sets the local variable "result" is set to NULL, which is useless. We must store NULL in the pointer variable whose address was passed to the function, so "*result = NULL" is correct. --- diff --git a/crypt.c b/crypt.c index f064fb3a..5b7029d3 100644 --- a/crypt.c +++ b/crypt.c @@ -204,7 +204,7 @@ out: ret = ret2; if (ret < 0) { free(key); - result = NULL; + *result = NULL; PARA_ERROR_LOG("key %s: %s\n", key_file, para_strerror(-ret)); } else *result = key;