diff -r d8e5ca139d7c -r 649586dc385a src/base/cprintf_formats.hh --- a/src/base/cprintf_formats.hh Wed Jun 20 19:32:42 2012 -0400 +++ b/src/base/cprintf_formats.hh Wed Jun 27 18:35:54 2012 +0100 @@ -203,16 +203,12 @@ int flen = foo.str().size(); if (fmt.width > flen) { - char *spaces = new char[fmt.width - flen + 1]; - memset(spaces, ' ', fmt.width - flen); - spaces[fmt.width - flen] = 0; + std::string spaces(fmt.width - flen, ' '); if (fmt.flush_left) out << foo.str() << spaces; else out << spaces << foo.str(); - - delete [] spaces; } else out << data; } else diff -r d8e5ca139d7c -r 649586dc385a src/mem/port_proxy.cc --- a/src/mem/port_proxy.cc Wed Jun 20 19:32:42 2012 -0400 +++ b/src/mem/port_proxy.cc Wed Jun 27 18:35:54 2012 +0100 @@ -58,11 +58,13 @@ void PortProxy::memsetBlob(Addr addr, uint8_t v, int size) const { - // quick and dirty... - uint8_t *buf = new uint8_t[size]; + if (size > 0) { + // quick and dirty... + uint8_t *buf = new uint8_t[size]; - std::memset(buf, v, size); - blobHelper(addr, buf, size, MemCmd::WriteReq); + std::memset(buf, v, size); + blobHelper(addr, buf, size, MemCmd::WriteReq); - delete [] buf; + delete [] buf; + } }