Hii Nickle,
On Mon, Feb 26, 2024 at 4:44 PM Nickle Wang <nick...@nvidia.com> wrote: > > 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 = 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 also > create a macro to implemented AsciiStrCpy. Please check below link to see my > changes: > https://github.com/tianocore/edk2/compare/0f391b1c2f988d90a3ac723b314ac28ba7b0b8df..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. -=-=-=-=-=-=-=-=-=-=-=- 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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-