diff options
author | Nickle Wang <nicklew@nvidia.com> | 2022-09-22 22:06:32 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-09-23 01:22:23 +0000 |
commit | 238f5f95448c0cbffab5532b21bc4d5f27cf1cee (patch) | |
tree | 4f8698444ea994939a6ae9f8b9deb50d578ce951 /RedfishPkg | |
parent | 6f340acfb10992af914ed5e17127cc786e0a7f7b (diff) | |
download | edk2-238f5f95448c0cbffab5532b21bc4d5f27cf1cee.tar.gz edk2-238f5f95448c0cbffab5532b21bc4d5f27cf1cee.tar.bz2 edk2-238f5f95448c0cbffab5532b21bc4d5f27cf1cee.zip |
RedfishPkg/JsonLib: Fix JsonLib build failure
VS2019 reports build failure: "warning C4701: potentially uninitialized
local variable 'Ucs2Str' used". Initial Ucs2Str to NULL at the beginning
of function.
Cc: Abner Chang <abner.chang@amd.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Reviewed-by: Abner Chang <abner.chang@amd.com>
Diffstat (limited to 'RedfishPkg')
-rw-r--r-- | RedfishPkg/Library/JsonLib/JsonLib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/RedfishPkg/Library/JsonLib/JsonLib.c b/RedfishPkg/Library/JsonLib/JsonLib.c index 75bd8f9853..5d75882004 100644 --- a/RedfishPkg/Library/JsonLib/JsonLib.c +++ b/RedfishPkg/Library/JsonLib/JsonLib.c @@ -6,6 +6,7 @@ Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
+ Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -569,6 +570,7 @@ JsonValueGetUnicodeString ( CONST CHAR8 *Utf8Str;
CHAR16 *Ucs2Str;
+ Ucs2Str = NULL;
Utf8Str = json_string_value ((json_t *)Json);
if (Utf8Str == NULL) {
return NULL;
|