summaryrefslogtreecommitdiff
path: root/src/lib/tests/du_buff_test.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-03-17 19:07:40 +0100
committerSander Vrijders <[email protected]>2016-03-17 19:07:40 +0100
commit8d2ac4877bb14df8e10d13b61d5db6c5e11d87c3 (patch)
treefd5f38f7488bab87232693ddcb7ce7723e72e2c0 /src/lib/tests/du_buff_test.c
parentd2bffe6cc47af18099d33b82920df0bb027da207 (diff)
parent112007d6308478c2dead8745024332b7299dd1a3 (diff)
downloadouroboros-8d2ac4877bb14df8e10d13b61d5db6c5e11d87c3.tar.gz
ouroboros-8d2ac4877bb14df8e10d13b61d5db6c5e11d87c3.zip
Merged in dstaesse/ouroboros/be-dubuff (pull request #36)
lib: fixes to du_buff
Diffstat (limited to 'src/lib/tests/du_buff_test.c')
-rw-r--r--src/lib/tests/du_buff_test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/tests/du_buff_test.c b/src/lib/tests/du_buff_test.c
index 2b7b5e55..bda1ca43 100644
--- a/src/lib/tests/du_buff_test.c
+++ b/src/lib/tests/du_buff_test.c
@@ -48,15 +48,20 @@ int du_buff_test(int argc, char ** argv)
if (dub == NULL)
return -1;
- if (k > DU_BLOCK_DATA_SIZE)
+ if (k > DU_BLOCK_DATA_SIZE) {
+ du_buff_destroy (dub);
continue;
+ }
- if (i - (j + k) > DU_BLOCK_DATA_SIZE)
+ if (i - (j + k) > DU_BLOCK_DATA_SIZE) {
+ du_buff_destroy (dub);
continue;
+ }
- if (du_buff_init(dub, k, bits, j) < 0)
+ if (du_buff_init(dub, k, bits, j) < 0) {
+ du_buff_destroy (dub);
return -1;
-
+ }
du_buff_destroy (dub);
}
}