REF: https://bugzilla.tianocore.org/show_bug.cgi?id=38

Set MPath to NULL after free(MPath) to guarantee that MPath
is not used after the free() call.

Cc: Rebecca Cran <rebe...@nuviainc.com>
Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>
---
 StdLib/LibC/Uefi/Devices/Utility/Path.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/StdLib/LibC/Uefi/Devices/Utility/Path.c 
b/StdLib/LibC/Uefi/Devices/Utility/Path.c
index d6728d3..fe19196 100644
--- a/StdLib/LibC/Uefi/Devices/Utility/Path.c
+++ b/StdLib/LibC/Uefi/Devices/Utility/Path.c
@@ -359,6 +359,7 @@ reclassify:
     }
     else if(MPath != NULL) {
       free(MPath);    /* Caller doesn't want it so let MPath go free */
+      MPath = NULL;
     }
 
     /*  At this point, WPath is an absolute path,
-- 
2.32.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79543): https://edk2.groups.io/g/devel/message/79543
Mute This Topic: https://groups.io/mt/84985779/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to