X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshcrcda.c;h=8d77cbb6052cf7e76256c6c628be7c8ec7a857dd;hb=f004bcca17a789356c32527a396b68b71a773db2;hp=7fb5767ce0a49e20bd09078501e3094f1203a05e;hpb=d36a4c3685f17057ba2c80ac471c1284b615469f;p=PuTTY.git diff --git a/sshcrcda.c b/sshcrcda.c index 7fb5767c..8d77cbb6 100644 --- a/sshcrcda.c +++ b/sshcrcda.c @@ -42,12 +42,6 @@ typedef unsigned short uint16; #define HASH_MINBLOCKS (7*SSH_BLOCKSIZE) -#define GET_32BIT_MSB_FIRST(cp) \ - (((unsigned long)(unsigned char)(cp)[0] << 24) | \ - ((unsigned long)(unsigned char)(cp)[1] << 16) | \ - ((unsigned long)(unsigned char)(cp)[2] << 8) | \ - ((unsigned long)(unsigned char)(cp)[3])) - /* Hash function (Input keys are cipher results) */ #define HASH(x) GET_32BIT_MSB_FIRST(x) @@ -71,7 +65,12 @@ void *crcda_make_context(void) void crcda_free_context(void *handle) { - sfree(handle); + struct crcda_ctx *ctx = (struct crcda_ctx *)handle; + if (ctx) { + sfree(ctx->h); + ctx->h = NULL; + sfree(ctx); + } } static void crc_update(uint32 *a, void *b)