X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=crypt.cpp;h=7868ceb9022d5b874daa66b8673a28bb6ead82a6;hp=2b75792585bb52503930c807b80dbeb2b213c8de;hb=ef3fc1931a2fa82f482d21fb1296735206463d3a;hpb=2746009aca7e00678ad6f5f64da8b208ab635d60 diff --git a/crypt.cpp b/crypt.cpp index 2b75792..7868ceb 100644 --- a/crypt.cpp +++ b/crypt.cpp @@ -293,10 +293,7 @@ unsigned long crc32(unsigned char *data, int len) unsigned long crc = 0xffffffff; if (!crc_initialized) - { - PERROR("crc not initialized, exitting..."); - exit(-1); - } + FATAL("crc not initialized, exitting..."); while (len--) crc = (crc >> 8) ^ crc32_table[(crc & 0xFF) ^ *data++]; @@ -577,8 +574,7 @@ static void *keyengine_child(void *arg) /* exit process */ apppbx->ea_endpoint->ep_use--; - memset(args, 0, sizeof(struct auth_args)); - free(args); + FREE(args, sizeof(struct auth_args)); amemuse--; return(NULL); } @@ -595,14 +591,7 @@ void EndpointAppPBX::cryptman_keyengine(int job) return; } - arg = (struct auth_args *)calloc(1, sizeof(struct auth_args)); - if (!arg) - { - PERROR("failed to alloc memory.\n"); - e_crypt_keyengine_return = -1; - return; - } - + arg = (struct auth_args *)MALLOC(sizeof(struct auth_args)); arg->apppbx = this; arg->job = job; e_crypt_keyengine_return = 0; @@ -2044,3 +2033,4 @@ void EndpointAppPBX::encrypt_result(int msg, char *text) } } +