]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
crypt: Really set result to NULL if get_asymmetric_key() fails.
authorAndre Noll <maan@systemlinux.org>
Mon, 15 Aug 2011 18:09:54 +0000 (20:09 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 16 Aug 2011 18:28:32 +0000 (20:28 +0200)
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

diff --git a/crypt.c b/crypt.c
index f064fb3a535d9df3306818d7e9c27ca85193bd50..5b7029d32d1aa906b8d5dae49a0e965af9d1c87f 100644 (file)
--- 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;