rem: array->key = p = (char*)malloc (n+1);
add: p = (char*)malloc (n+1);
context: parse_dn_part (DnPair *array, const unsigned char *string){  const unsigned char *s, *s1;  size_t n;  char *p;  /* parse attributeType */  for (s = string+1; *s && *s != '='; s++)    ;  if (!*s)    return NULL; /* error */  n = s - string;  if (!n)    return NULL; /* empty key */  array->key = p = (char*)malloc (n+1);      memcpy (p, string, n);  p[n] = 0;  trim_trailing_spaces ((char*)p);  // map OIDs to their names:  for ( unsigned int i = 0 ; i < numOidMaps ; ++i )    if ( !strcmp ((char*)p, oidmap[i].oid) ) {      strcpy ((char*)p, oidmap[i].name);      break;    }  string = s + 1;  if (*string == '#')    { /* hexstring */      string++;      for (s=string; hexdigitp (s); s++)        s++;      n = s - string;      if (!n || (n & 1))        return NULL; /* empty or odd number of digits */      n /= 2;      array->value = p = (char*)malloc (n+1);                  for (s1=string; n; s1 += 2, n--)        *p++ = xtoi_2 (s1);      *p = 0;   }  else    { /* regular v3 quoted string */      for (n=0, s=string; *s; s++)        {          if (*s == '\\')            { /* pair */              s++;              if (*s == ',' || *s == '=' || *s == '+'                  || *s == '<' || *s == '>' || *s == '#' || *s == ';'                   || *s == '\\' || *s == '\"' || *s == ' ')                n++;              else if (hexdigitp (s) && hexdigitp (s+1))                {                  s++;                  n++;                }              else                return NULL; /* invalid escape sequence */            }          else if (*s == '\"')            return NULL; /* invalid encoding */          else if (*s == ',' || *s == '=' || *s == '+'                   || *s == '<' || *s == '>' || *s == '#' || *s == ';' )            break;           else            n++;        }      array->value = p = (char*)malloc (n+1);                  for (s=string; n; s++, n--)        {          if (*s == '\\')            {               s++;              if (hexdigitp (s))                {                  *p++ = xtoi_2 (s);                  s++;                }              else                *p++ = *s;            }          else            *p++ = *s;        }      *p = 0;    }  return s;}