-fix NPE
[oweals/gnunet.git] / src / transport / gnunet-service-transport_ats.c
index 8c3c5fed881f143bc247defabdcb3721f778997b..55b5e20a17e3575bde71494ad65f5254778054c8 100644 (file)
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file transport/gnunet-service-transport_ats.h
@@ -708,8 +708,11 @@ GST_ats_expire_address (const struct GNUNET_HELLO_Address *address)
   if (NULL != ai->session)
   {
     ai->expired = GNUNET_YES;
-    GNUNET_ATS_address_destroy (ai->ar);
-    ai->ar = NULL;
+    if (NULL != ai->ar)
+    {
+      GNUNET_ATS_address_destroy (ai->ar);
+      ai->ar = NULL;
+    }
     return;
   }
   GNUNET_assert (GNUNET_YES ==