X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Ftest_container_multipeermap.c;h=3f7b44da5e516f7629e5416732c41fc4bded93cb;hb=6ede545d597509fefcc3d4fd2ef865bc5f57603f;hp=2619aa1330309bc89472cafc929dfc53a012ace5;hpb=c2d9d1e64c9801122caaa6b429fc67706db5c9d7;p=oweals%2Fgnunet.git diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c index 2619aa133..3f7b44da5 100644 --- a/src/util/test_container_multipeermap.c +++ b/src/util/test_container_multipeermap.c @@ -1,21 +1,19 @@ /* 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. - - 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. + 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 . */ /** @@ -27,7 +25,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 +34,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 +95,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;