beecrypt: fix memory leak in test

Closes Homebrew/homebrew#39393.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
This commit is contained in:
Viktor Szakats 2015-05-05 17:20:15 +02:00 committed by Tim D. Smith
parent 452bfa8861
commit 9c51719c22

View file

@ -41,13 +41,16 @@ class Beecrypt < Formula
sha256Param hash;
const byte *string = (byte *) "abc";
byte digest[32];
byte *crc;
sha256Reset(&hash);
sha256Update(&hash, string, sizeof(string) / sizeof(*string));
sha256Process(&hash);
sha256Digest(&hash, digest);
printf("%s\\n", b64crc(digest, 32));
printf("%s\\n", crc = b64crc(digest, 32));
free(crc);
return 0;
}