*did = NULL;
*did = 0;
ipsec_clone_id (u_int8_t **did, size_t *did_len, u_int8_t *id, size_t id_len){  if (*did)    free (*did);  if (!id_len || id == NULL)    {      *did = NULL;      *did_len = 0;      return 0;    }  *did = malloc (id_len);  if (*did == NULL)    {      *did_len = 0;      log_error ("ipsec_clone_id: malloc(%d) failed", id_len);      return -1;    }  *did_len = id_len;  memcpy (*did, id, id_len);  return 0;}