From 7777f922c8381b0d59ff7d67d05dbde6f5ba8da8 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 24 Nov 2021 17:12:54 -0800 Subject: [PATCH] ... --- inc/block.h | 1 - src/block.c | 5 ----- test/unit/block.tests.c | 1 - 3 files changed, 7 deletions(-) diff --git a/inc/block.h b/inc/block.h index fa7496d..d3798ba 100644 --- a/inc/block.h +++ b/inc/block.h @@ -10,7 +10,6 @@ #define BLOCK_SIZE 16384 struct block { - uint8_t *data; unsigned char hash[crypto_hash_sha256_BYTES]; struct block *next; }; diff --git a/src/block.c b/src/block.c index bbff2ea..6870fd2 100644 --- a/src/block.c +++ b/src/block.c @@ -28,10 +28,6 @@ void block_free(struct block *p) { struct block *next; while(p!=NULL) { - if(p->data!=NULL) { - free(p->data); - } - next = p->next; free(p); p = next; @@ -47,7 +43,6 @@ int block_init(struct block **p) { return -1; } - (*p)->data = NULL; memset((*p)->hash,0,crypto_hash_sha256_BYTES); (*p)->next = NULL; diff --git a/test/unit/block.tests.c b/test/unit/block.tests.c index 984bcf9..21cd4d9 100644 --- a/test/unit/block.tests.c +++ b/test/unit/block.tests.c @@ -65,7 +65,6 @@ static void block_init_basic_test() { assert(block_init(NULL)==-1); assert(block_init(&p)==1); - assert(p->data==NULL); assert(p->next==NULL); assert(memcmp(p->hash,expected,crypto_hash_sha256_BYTES)==0); -- 2.39.5