From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C65597803D0 for ; Tue, 27 Feb 2024 00:14:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=13NvPQZcBsieg5q3SOcgc7tcf7Weg9ljpSxlBRgP5zQ=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1708992841; v=1; b=MxhMVq3CTUGCoxkujBok8iWShtRUe+Hwm/4sD9sjwB32zyiBZyS1sMLIm2F1a3w1w0yIAHVy oeKvTCUDvuckZxRi8YqIqD85uTzbkCTZAj15LB+Op035uZ/GiUoN/AN2lW+vRvUWZ0goXnykSPx bJn7fbhIk8GNC1rMexWpU2hU= X-Received: by 127.0.0.2 with SMTP id ZnOOYY7687511x4rmMyPJPdY; Mon, 26 Feb 2024 16:14:01 -0800 X-Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) by mx.groups.io with SMTP id smtpd.web10.1306.1708992840743503278 for ; Mon, 26 Feb 2024 16:14:00 -0800 X-Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-607c5679842so37364127b3.2 for ; Mon, 26 Feb 2024 16:14:00 -0800 (PST) X-Gm-Message-State: erT3NRKuir2RejmWQ4Fn6HsQx7686176AA= X-Google-Smtp-Source: AGHT+IH23q6T+2XTEs/OMnYWRAtA9Woo2Nmh6n05y6FdULjKQLg00wOxaWctgnZOu4WPo/ASI85PFKkWC3xlp1JQd/0= X-Received: by 2002:a0d:ec0d:0:b0:607:a0cf:d9ff with SMTP id q13-20020a0dec0d000000b00607a0cfd9ffmr632237ywn.31.1708992839856; Mon, 26 Feb 2024 16:13:59 -0800 (PST) MIME-Version: 1.0 References: <20240222091122.644-1-nicklew@nvidia.com> <9A76E719-1472-4E4C-A480-B38C7D305AAF@gmail.com> In-Reply-To: From: "Mike Maslenkin" Date: Tue, 27 Feb 2024 03:13:23 +0300 Message-ID: Subject: Re: [edk2-devel] [PATCH v2 2/6] RedfishPkg: implement Redfish HTTP protocol To: Nickle Wang Cc: "devel@edk2.groups.io" , Igor Kulchytskyy , Abner Chang , Nick Ramirez Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=MxhMVq3C; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hii Nickle, On Mon, Feb 26, 2024 at 4:44=E2=80=AFPM Nickle Wang wr= ote: > > Hi Mike, > > > So finally we have > > HttpFreeHeaderFields (Response->Headers, Response->HeaderCount); > > but Response->HeaderCount does not count partially allocated elements. = Right? > > > > To fix this, it is required to set > > *DstHeaderCount =3D SrcHeaderCount unconditionally right after > > DstHeaders allocation, and HttpFreeHeaderFields() will do the work > > then. > > I follow your suggestion to update DstHeaderCount right after DstHeaders = is allocated. So, HttpFreeHeaderFields can release headers correctly. I al= so create a macro to implemented AsciiStrCpy. Please check below link to se= e my changes: > https://github.com/tianocore/edk2/compare/0f391b1c2f988d90a3ac723b314ac28= ba7b0b8df..f0fa1b8fdcd933beb52fd3127c2476443c00ef8d These changes looks good. Internal strings initialization/deinitialization code much cleaner now and possible leak seems to have been fixed. Thank you! Regards, Mike. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115981): https://edk2.groups.io/g/devel/message/115981 Mute This Topic: https://groups.io/mt/104505404/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-