X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=Source%2Fcharon%2Fencoding%2Fmessage.c;h=5fb6fa33dd49fb46cef0c2eccf76b724b542e28e;hp=d1fd3a2f352327550fe5fc7a8ff83703d399459a;hb=0f30f5686a8baace9da905071c32e2575913e33e;hpb=5e99853ca819ff3b62bd72f0660eb607a14346e2 diff --git a/Source/charon/encoding/message.c b/Source/charon/encoding/message.c index d1fd3a2..5fb6fa3 100644 --- a/Source/charon/encoding/message.c +++ b/Source/charon/encoding/message.c @@ -514,13 +514,8 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t* { iterator->current(iterator, (void**)&next_payload); payload->set_next_type(payload, next_payload->get_type(next_payload)); - status = generator->generate_payload(generator, payload); - if (status != SUCCESS) - { - generator->destroy(generator); - ike_header->destroy(ike_header); - return status; - } + generator->generate_payload(generator, payload); + payload = next_payload; } iterator->destroy(iterator); @@ -540,13 +535,7 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t* return status; } } - status = generator->generate_payload(generator, payload); - if (status != SUCCESS) - { - generator->destroy(generator); - ike_header->destroy(ike_header); - return status; - } + generator->generate_payload(generator, payload); ike_header->destroy(ike_header); /* build packet */ @@ -554,12 +543,8 @@ static status_t generate(private_message_t *this, crypter_t *crypter, signer_t* { allocator_free(this->packet->data.ptr); } - status = generator->write_to_chunk(generator, &(this->packet->data)); + generator->write_to_chunk(generator, &(this->packet->data)); generator->destroy(generator); - if (status != SUCCESS) - { - return status; - } /* append integrity checksum if necessary */ if (payload->get_type(payload) == ENCRYPTED)