From c6991cf20bdfe7426e536f7020a0ff741df84dee Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 15 Aug 2011 20:09:54 +0200 Subject: [PATCH] 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. --- crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.2