summaryrefslogtreecommitdiff
path: root/huffman.c
diff options
context:
space:
mode:
Diffstat (limited to 'huffman.c')
-rw-r--r--huffman.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/huffman.c b/huffman.c
index cc0c553..a1141a8 100644
--- a/huffman.c
+++ b/huffman.c
@@ -64,7 +64,6 @@ static int GetCompBit(uint8_t *comparray, uint32_t bitoffset);
double
DoHuffman(void)
{
- const char* context = "CPU:Huffman";
char* comparray = NULL;
char* decomparray = NULL;
char* plaintext = NULL;
@@ -85,34 +84,12 @@ DoHuffman(void)
** estimate...but, who cares?)
*/
plaintext = malloc(ARRAY_SIZE * sizeof(char));
- if (!plaintext) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- exit(1);
- }
comparray = malloc(ARRAY_SIZE * sizeof(char));
- if (!comparray) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- free(plaintext);
- exit(1); /* FIXME: do I need exits here? */
- }
decomparray = malloc(ARRAY_SIZE * sizeof(char));
- if (!decomparray) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- free(plaintext);
- free(comparray);
- exit(1);
- }
hufftree = malloc(sizeof(huff_node) * 512);
- if (!hufftree) {
- fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
- free(plaintext);
- free(comparray);
- free(decomparray);
- exit(1);
- }
/*
** Build the plaintext buffer. Since we want this to