fixed crash bug when doing "ipsec down" with an unknown connection
authorMartin Willi <martin@strongswan.org>
Fri, 25 Aug 2006 09:19:42 +0000 (09:19 -0000)
committerMartin Willi <martin@strongswan.org>
Fri, 25 Aug 2006 09:19:42 +0000 (09:19 -0000)
src/charon/config/connections/local_connection_store.c

index 1f961cb..024754e 100644 (file)
@@ -162,8 +162,11 @@ static connection_t *get_connection_by_name(private_local_connection_store_t *th
        iterator->destroy(iterator);
        pthread_mutex_unlock(&(this->mutex));
        
-       /* get a new reference for it */
-       found->get_ref(found);
+       if (found)
+       {
+               /* get a new reference for it */
+               found->get_ref(found);
+       }
        return found;
 }