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.
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;