summaryrefslogtreecommitdiff
path: root/idea.c
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-17 20:43:00 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-17 20:43:00 +0000
commitd064ec35868720e0f29c1fe53a6e688333e71736 (patch)
tree3662aad3e5a9b536de44a3d85a8720ea06812ba9 /idea.c
parent10a5d62de08035803b5fadc5fcd32c873f8b1702 (diff)
Remove malloc return checks. Since they're in loops, they don't prevent memory from being leaked after the first iteration. Plus, when does malloc fail?
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@78 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
Diffstat (limited to 'idea.c')
-rw-r--r--idea.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/idea.c b/idea.c
index ffa51ac..391dbff 100644
--- a/idea.c
+++ b/idea.c
@@ -62,7 +62,6 @@ static void cipher_idea(uint16_t in[4], uint16_t out[4], IDEAkey Z);
double
DoIDEA(void)
{
- const char* context = "CPU:IDEA";
unsigned char* plain1 = NULL; /* First plaintext buffer */
unsigned char* crypt1 = NULL; /* Encryption buffer */
unsigned char* plain2 = NULL; /* Second plaintext buffer */
@@ -100,25 +99,11 @@ DoIDEA(void)
** Also, fill up plain1 with sample text.
*/
plain1 = malloc(ARRAY_SIZE);
- if (!plain1) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- exit(1);
- }
crypt1 = malloc(ARRAY_SIZE);
- if (!crypt1) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- free(plain1);
- exit(1);
- }
plain2 = malloc(ARRAY_SIZE);
- if (!plain2) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- free(plain1);
- free(plain2);
- exit(1);
- }
+
/*
** Note that we build the "plaintext" by simply loading
** the array up with random numbers.