PRUint8* buf = (PRUint8*) PR_Malloc(len);
PRUint8* buf = (PRUint8*) nsMemory::Alloc(len);
GetNAME(HDC aDC, nsString* aName){  DWORD len = GetFontData(aDC, NAME, 0, nsnull, 0);  if (len == GDI_ERROR) {    return eGetName_GDIError;  }  if (!len) {    return eGetName_OtherError;  }  PRUint8* buf = (PRUint8*) PR_Malloc(len);  if (!buf) {    return eGetName_OtherError;  }  DWORD newLen = GetFontData(aDC, NAME, 0, buf, len);  if (newLen != len) {    PR_Free(buf);    return eGetName_OtherError;  }  PRUint8* p = buf + 2;  PRUint16 n = GET_SHORT(p);  p += 2;  PRUint16 offset = GET_SHORT(p);  p += 2;  PRUint16 i;  PRUint16 idLength;  PRUint16 idOffset;  for (i = 0; i < n; ++i) {    PRUint16 platform = GET_SHORT(p);    p += 2;    PRUint16 encoding = GET_SHORT(p);    p += 4;    PRUint16 name = GET_SHORT(p);    p += 2;    idLength = GET_SHORT(p);    p += 2;    idOffset = GET_SHORT(p);    p += 2;    // encoding: 1 == Unicode; 0 == symbol    if ((platform == 3) && ((encoding == 1) || (!encoding)) && (name == 3)) {      break;    }  }  if (i == n) {    PR_Free(buf);    return eGetName_OtherError;  }  p = buf + offset + idOffset;  idLength /= 2;  for (i = 0; i < idLength; ++i) {    PRUnichar c = GET_SHORT(p);    p += 2;    aName->Append(c);  }  PR_Free(buf);  return eGetName_OK;}