summaryrefslogtreecommitdiff
path: root/libpiano/src/crypt.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-19 17:00:25 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-06-19 17:00:25 +0200
commitcc038afd9d9cca3c7eb50b71d133da73fa39f8af (patch)
tree4def8ee0dfd61a814d18fe9e878f3e4a6b130b0f /libpiano/src/crypt.c
parent880a0446c465d22ea3e36db838b8df1e594fa4da (diff)
downloadpianobar-cc038afd9d9cca3c7eb50b71d133da73fa39f8af.tar.gz
pianobar-cc038afd9d9cca3c7eb50b71d133da73fa39f8af.tar.bz2
pianobar-cc038afd9d9cca3c7eb50b71d133da73fa39f8af.zip
piano: Using own free () wrapper now
PS: "lib:" prefix is now "piano:"; I may add other libraries (last.fm support e.g.)
Diffstat (limited to 'libpiano/src/crypt.c')
-rw-r--r--libpiano/src/crypt.c9
1 files changed, 5 insertions, 4 deletions
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;
}