]> git.proxmox.com Git - mirror_edk2.git/commit - BaseTools/Source/C/VfrCompile/VfrFormPkg.h
BaseTools/VfrCompile: Avoid freeing freed memory in classes
authorHao Wu <hao.a.wu@intel.com>
Tue, 27 Sep 2016 05:43:32 +0000 (13:43 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 8 Nov 2016 08:37:23 +0000 (16:37 +0800)
commit77dee0b1859dd0c7698b9f5a9510bee6d733c8c4
tree9adf83ba22f38ed4850cf9373a2dd6eb7bfb2735
parent0d46defefa871d0b9583dfc4cb1985a5b0835ada
BaseTools/VfrCompile: Avoid freeing freed memory in classes

For classes that contain dynamically allocated data members, copy
constructor and assignment operator should be implemented or both
operations should be prohibited to avoid freeing freed memory caused by
shallow copy.

This commit declares both copy constructor and assignment operator as
'private' for classes that contain dynamically allocated data members.
This will prevent freeing already freed memory.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/C/VfrCompile/Pccts/h/DLexerBase.h
BaseTools/Source/C/VfrCompile/VfrError.h
BaseTools/Source/C/VfrCompile/VfrFormPkg.h
BaseTools/Source/C/VfrCompile/VfrUtilityLib.h