From 238f5f95448c0cbffab5532b21bc4d5f27cf1cee Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Thu, 22 Sep 2022 22:06:32 +0800 Subject: 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 Cc: Nick Ramirez Signed-off-by: Nickle Wang Reviewed-by: Abner Chang --- RedfishPkg/Library/JsonLib/JsonLib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'RedfishPkg') 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.
(C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ 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; -- cgit v1.2.3