Check if we actually have an initiating packet to free while processing responses
authorMartin Willi <martin@revosec.ch>
Wed, 23 May 2012 09:50:12 +0000 (11:50 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 23 May 2012 09:50:12 +0000 (11:50 +0200)
src/libcharon/sa/ikev1/task_manager_v1.c

index 1639125..e6e7a0d 100644 (file)
@@ -978,7 +978,7 @@ static status_t process_response(private_task_manager_t *this,
        enumerator->destroy(enumerator);
 
        this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
-       this->initiating.packet->destroy(this->initiating.packet);
+       DESTROY_IF(this->initiating.packet);
        this->initiating.packet = NULL;
 
        if (this->queued && this->active_tasks->get_count(this->active_tasks) == 0)