Commit 31c85e36 authored by Sam Schmalzried's avatar Sam Schmalzried

Added manual memory frees

parent 80ed56a5
......@@ -42,6 +42,8 @@ int main(int argc, char* argv[]) {
binaryTo64(binaryString, base64String);
printf("%s\n", base64String);
free(binaryString);
free(base64String);
return 0;
......@@ -81,8 +83,9 @@ void binaryTo64(char* binaryString, char* base64String) {
strncpy(binaryPiece, binaryString + i, 6*sizeof(char));
binaryNum = strtol(binaryPiece, NULL, 2);
strncat(base64String, cb64+binaryNum, 1);
printf("%s\n", base64String);
}
free(binaryPiece);
}
void padZeroes(char* binaryString, int numZeroes) {
......@@ -94,5 +97,7 @@ void padZeroes(char* binaryString, int numZeroes) {
}
strcat(tempString, binaryString);
strcpy(binaryString, tempString);
free(tempString);
return;
}
\ No newline at end of file
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment