X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Ftest_container_multipeermap.c;h=a8ec8b8f241852adfb558d2fe948ffb4e1e9d28f;hb=8b6b7febc5af8f10e308f41730ef3c8297f8e55e;hp=2cd736913990f5065108cdf0a2d67d5e885469e3;hpb=f27338992f0a5915ee974faea05f764c2df6f584;p=oweals%2Fgnunet.git diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c index 2cd736913..a8ec8b8f2 100644 --- a/src/util/test_container_multipeermap.c +++ b/src/util/test_container_multipeermap.c @@ -1,21 +1,21 @@ /* This file is part of GNUnet. - Copyright (C) 2008, 2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2008, 2013 GNUnet e.V. - GNUnet is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 3, or (at your - option) any later version. + GNUnet is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, + or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . - 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., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. + SPDX-License-Identifier: AGPL3.0-or-later */ /** @@ -27,7 +27,7 @@ #include "platform.h" #include "gnunet_util_lib.h" -#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy(m); return 1; } +#define ABORT() { fprintf(stderr, "Error at %s:%d\n", __FILE__, __LINE__); if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy(m); if (NULL != iter) GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); return 1; } #define CHECK(c) { if (! (c)) ABORT(); } static int @@ -36,7 +36,7 @@ testMap (int i) struct GNUNET_CONTAINER_MultiPeerMap *m; struct GNUNET_PeerIdentity k1; struct GNUNET_PeerIdentity k2; - struct GNUNET_CONTAINER_MultiPeerMapIterator *iter; + struct GNUNET_CONTAINER_MultiPeerMapIterator *iter = NULL; struct GNUNET_PeerIdentity key_ret; const char *ret; int j; @@ -97,7 +97,7 @@ testMap (int i) for (j = 0; j < GNUNET_CONTAINER_multipeermap_size (m); j++) CHECK (GNUNET_YES == GNUNET_CONTAINER_multipeermap_iterator_next (iter, NULL, NULL)); CHECK (GNUNET_NO == GNUNET_CONTAINER_multipeermap_iterator_next (iter, NULL, NULL)); - GNUNET_free (iter); + GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); GNUNET_CONTAINER_multipeermap_destroy (m); return 0;