message: Make packet argument optional in generate()
authorTobias Brunner <tobias@strongswan.org>
Thu, 12 Jun 2014 08:01:18 +0000 (10:01 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 10 Oct 2014 07:30:26 +0000 (09:30 +0200)
src/libcharon/encoding/message.c

index 435b982..44221b6 100644 (file)
@@ -1650,7 +1650,10 @@ METHOD(message_t, generate, status_t,
                }
        }
        generator->destroy(generator);
-       *packet = this->packet->clone(this->packet);
+       if (packet)
+       {
+               *packet = this->packet->clone(this->packet);
+       }
        return SUCCESS;
 }