search_val[search_len].zattr_val.zattr_val_len = 0; ibreq->ibr_srch.ibr_srch_val = search_val; ibreq->ibr_srch.ibr_srch_len = search_len + 1;
__create_ib_request (const_nis_name name, unsigned int flags){  struct ib_request *ibreq = calloc (1, sizeof (ib_request));  char buf[strlen (name) + 1];  nis_attr *search_val = NULL;  int search_len = 0;  char *cptr;  size_t size = 0;  ibreq->ibr_flags = flags;  cptr = strcpy (buf, name);  /* Not of "[key=value,key=value,...],foo.." format? */  if (cptr[0] != '[')    {      ibreq->ibr_name = strdup (cptr);      return ibreq;    }  /* "[key=value,...],foo" format */  ibreq->ibr_name = strchr (cptr, ']');  if (ibreq->ibr_name == NULL || ibreq->ibr_name[1] != ',')    return NULL;  /* Check if we have an entry of "[key=value,],bar". If, remove the "," */  if (ibreq->ibr_name[-1] == ',')    ibreq->ibr_name[-1] = '\0';  else    ibreq->ibr_name[0] = '\0';  ibreq->ibr_name += 2;  ibreq->ibr_name = strdup (ibreq->ibr_name);  ++cptr; /* Remove "[" */  while (cptr != NULL && cptr[0] != '\0')    {      char *key = cptr;      char *val = strchr (cptr, '=');      cptr = strchr (key, ',');      if (cptr != NULL)	*cptr++ = '\0';      if (!val)	{	  nis_free_request (ibreq);	  return NULL;	}      *val++ = '\0';      if ((search_len + 1) >= size)        {          size += 1;          search_val = realloc (search_val, size * sizeof (nis_attr));	  if (search_val == NULL)	    {	      nis_free_request (ibreq);	      return NULL;	    }	}      search_val[search_len].zattr_ndx = strdup (key);      if ((search_val[search_len].zattr_ndx) == NULL)        {	  nis_free_request (ibreq);	  return NULL;        }      search_val[search_len].zattr_val.zattr_val_len = strlen (val) + 1;      search_val[search_len].zattr_val.zattr_val_val = strdup (val);      if (search_val[search_len].zattr_val.zattr_val_val == NULL)        {	  nis_free_request (ibreq);          return NULL;        }      ++search_len;    }  ibreq->ibr_srch.ibr_srch_val = search_val;  ibreq->ibr_srch.ibr_srch_len = search_len;  return ibreq;}