From cc038afd9d9cca3c7eb50b71d133da73fa39f8af Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Thu, 19 Jun 2008 17:00:25 +0200 Subject: piano: Using own free () wrapper now PS: "lib:" prefix is now "piano:"; I may add other libraries (last.fm support e.g.) --- libpiano/src/crypt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libpiano/src/crypt.c') diff --git a/libpiano/src/crypt.c b/libpiano/src/crypt.c index 10744e0..c4871dc 100644 --- a/libpiano/src/crypt.c +++ b/libpiano/src/crypt.c @@ -26,6 +26,7 @@ THE SOFTWARE. #include "crypt_key_output.h" #include "crypt_key_input.h" +#include "main.h" /* hex string to array of unsigned int values * @param hex string @@ -133,8 +134,8 @@ char *PianoDecryptString (char *strInput) { PianoDecipherInts (cipherInts, cipherIntsN, &plainInts); strDecrypted = PianoIntsToString (plainInts, cipherIntsN); - free (cipherInts); - free (plainInts); + PianoFree (cipherInts, cipherIntsN * sizeof (*cipherInts)); + PianoFree (plainInts, cipherIntsN * sizeof (*plainInts)); return strDecrypted; } @@ -258,8 +259,8 @@ char *PianoEncryptString (char *strInput) { PianoEncipherInts (plainInts, plainIntsN, &cipherInts); strHex = PianoIntsToHexString (cipherInts, plainIntsN); - free (plainInts); - free (cipherInts); + PianoFree (plainInts, plainIntsN * sizeof (*plainInts)); + PianoFree (cipherInts, plainIntsN * sizeof (*cipherInts)); return strHex; } -- cgit v1.2.3