rem: if (action) soap->action = soap_strdup(soap, action);
context: soap_connect_command(struct soap *soap, int http_command, const char *endpoint, const char *action){ char host[sizeof(soap->host)];  int port;  size_t count;  soap->error = SOAP_OK;  strcpy(host, soap->host); /* save to compare */  port = soap->port; /* save to compare */  soap_set_endpoint(soap, endpoint);  if (action)    soap->action = soap_strdup(soap, action);#ifndef WITH_LEANER  if (soap->fconnect)  { if ((soap->error = soap->fconnect(soap, endpoint, soap->host, soap->port)))      return soap->error;  }  else#endif  if (soap->fopen && *soap->host)  { soap->status = http_command;    if (!soap->keep_alive || !soap_valid_socket(soap->socket) || strcmp(soap->host, host) || soap->port != port || !soap->fpoll || soap->fpoll(soap))    { soap->keep_alive = 0; /* force close */      soap_closesock(soap);      DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Connect/reconnect to host='%s' path='%s' port=%d\n", soap->host, soap->path, soap->port));      soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port);      if (soap->error)        return soap->error;      soap->keep_alive = ((soap->omode & SOAP_IO_KEEPALIVE) != 0);    }  }  if (soap_begin_send(soap))    return soap->error;  count = soap_count_attachments(soap);#ifndef WITH_NOHTTP  if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_XML) && endpoint)  { unsigned int k = soap->mode;    soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);    if ((k & SOAP_IO) != SOAP_IO_FLUSH)      soap->mode |= SOAP_IO_BUFFER;    if ((soap->error = soap->fpost(soap, endpoint, soap->host, soap->port, soap->path, action, count)))      return soap->error;#ifndef WITH_LEANER    if ((k & SOAP_IO) == SOAP_IO_CHUNK)    { if (soap_flush(soap))        return soap->error;    }#endif    soap->mode = k;  }  if (http_command != SOAP_POST)    return soap_end_send(soap);#endif  return SOAP_OK;}