From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=eric.jin@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0843E2116746B for ; Sat, 13 Oct 2018 18:59:04 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2018 18:59:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,379,1534834800"; d="scan'208";a="100044470" Received: from jjin9-mobl.ccr.corp.intel.com ([10.249.168.56]) by orsmga002.jf.intel.com with ESMTP; 13 Oct 2018 18:59:03 -0700 From: Eric Jin To: edk2-devel@lists.01.org Cc: Supreeth Venkatesh , Jiaxin Wu Date: Sun, 14 Oct 2018 09:58:58 +0800 Message-Id: <20181014015858.3852-1-eric.jin@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [PATCH] uefi-sct/SctPkg:Fix the incorrect buffer free in SctAPrint() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2018 01:59:05 -0000 Cc: Supreeth Venkatesh Cc: Jiaxin Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Jin --- uefi-sct/SctPkg/Library/SctLib/Print.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uefi-sct/SctPkg/Library/SctLib/Print.c b/uefi-sct/SctPkg/Library/SctLib/Print.c index c25aff11..e523073a 100644 --- a/uefi-sct/SctPkg/Library/SctLib/Print.c +++ b/uefi-sct/SctPkg/Library/SctLib/Print.c @@ -2,7 +2,7 @@ Copyright 2006 - 2015 Unified EFI, Inc.
Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved.
- Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -676,7 +676,9 @@ _IPrint ( } ret = _Print (&ps); - SctFreePool(ps.fmt.u.pw); + if (fmt) { + SctFreePool(ps.fmt.u.pw); + } return ret; } -- 2.18.0.windows.1