- freeing of NULL pointer is checked
authorJan Hutter <jhutter@hsr.ch>
Tue, 8 Nov 2005 06:48:12 +0000 (06:48 -0000)
committerJan Hutter <jhutter@hsr.ch>
Tue, 8 Nov 2005 06:48:12 +0000 (06:48 -0000)
Source/charon/packet.c

index f67d7a6..2d82bce 100644 (file)
 
 static status_t destroy(packet_t *this)
 {
-       pfree(this->data.ptr);
+       if (this->data.ptr != NULL)
+       {
+               pfree(this->data.ptr);
+       }
        pfree(this);
        return SUCCESS;
 }