Ignore:
Timestamp:
Oct 29, 2011, 4:43:41 PM (14 years ago)
Author:
dmik
Message:

common: Use malloc/free for void pointers instead of new/delete.

This fixes GCC warnings and is more clear anyway (new/delete is for
types with the known structure).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gcc-kmk/tools/common/kFilePE.cpp

    r21759 r21760  
    1111******************************************************************************/
    1212#include <string.h>
     13#include <malloc.h>
    1314
    1415#include "MZexe.h"
     
    7677
    7778            /* create mapping */
    78    pvBase = new char [pehdr.OptionalHeader.SizeOfImage];
     79   pvBase = malloc(pehdr.OptionalHeader.SizeOfImage);
    7980   if (pvBase == NULL)
    8081       throw(kError(kError::NOT_ENOUGH_MEMORY));
     
    139140   catch (kError err)
    140141   {
    141        delete(pvBase);
     142       free(pvBase);
    142143       pvBase = NULL;
    143144       throw(err);
     
    152153{
    153154    if (pvBase)
    154         delete(pvBase);
     155        free(pvBase);
    155156}
    156157
Note: See TracChangeset for help on using the changeset viewer.