X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffragmentation%2Ffragmentation.c;h=ecd82b2c4ba4e1809ebfa6fae1bcaa28b46b0b61;hb=ecc2c2e4f440fcfaeb267e41a929abe6c6d5b949;hp=437104c75d2f8e03d478e02e3858852f7dcf5418;hpb=44e117cbab54ec4ed04e53a9498fd667bb4ddc69;p=oweals%2Fgnunet.git diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index 437104c75..ecd82b2c4 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c @@ -4,7 +4,7 @@ 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 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GNUnet is distributed in the hope that it will be useful, but @@ -35,10 +35,12 @@ #include "gnunet_fragmentation_lib.h" #include "gnunet_protocols.h" #include "gnunet_util_lib.h" + /** * Message fragment. This header is followed * by the actual data of the fragment. */ + struct Fragment { @@ -181,10 +183,16 @@ void GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *ctx) { struct GNUNET_FRAGEMENT_Ctxbuffer *buffer; - for(buffer = ctx->buffer; buffer!=NULL; buffer = buffer->next){ - GNUNET_free(buffer->num); - GNUNET_free(buffer); - } + struct GNUNET_FRAGEMENT_Ctxbuffer *temp; + buffer = ctx->buffer; + + while (buffer != NULL) + { + temp = buffer->next; + GNUNET_free(buffer->num); + GNUNET_free(buffer); + buffer = temp; + } GNUNET_free(ctx); GNUNET_assert (0); }