Changeset 21916 for trunk/tools/common/kFilePE.cpp
- Timestamp:
- Dec 18, 2011, 10:28:22 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 bin 2 Makefile.inc 1 env.cmd 2 LocalConfig.kmk
-
-
Property svn:mergeinfo
set to
/branches/gcc-kmk merged eligible
- Property svn:ignore
-
trunk/tools/common/kFilePE.cpp
r8003 r21916 11 11 ******************************************************************************/ 12 12 #include <string.h> 13 #include <malloc.h> 13 14 14 15 #include "MZexe.h" … … 36 37 * @remark throws errorcode 37 38 */ 38 kFilePE::kFilePE(kFile *pFile) :39 kFilePE::kFilePE(kFile *pFile) throw (kError) : 39 40 kFileFormatBase(pFile), 40 41 pvBase(NULL), … … 76 77 77 78 /* create mapping */ 78 pvBase = new char [pehdr.OptionalHeader.SizeOfImage];79 pvBase = malloc(pehdr.OptionalHeader.SizeOfImage); 79 80 if (pvBase == NULL) 80 81 throw(kError(kError::NOT_ENOUGH_MEMORY)); … … 93 94 94 95 /* read sections */ 95 for (int i = 0; i < pehdr.FileHeader.NumberOfSections; i++) 96 int i; 97 for (i = 0; i < pehdr.FileHeader.NumberOfSections; i++) 96 98 { 97 99 unsigned long cbSection; … … 138 140 catch (kError err) 139 141 { 140 delete(pvBase);142 free(pvBase); 141 143 pvBase = NULL; 142 144 throw(err); … … 148 150 * Destructor. 149 151 */ 150 kFilePE::~kFilePE() 152 kFilePE::~kFilePE() throw (kError) 151 153 { 152 154 if (pvBase) 153 delete(pvBase);155 free(pvBase); 154 156 } 155 157
Note:
See TracChangeset
for help on using the changeset viewer.