fix: remove some free
This commit is contained in:
@@ -643,8 +643,6 @@ const char *ChaCha20_DRBG_Generate_algorithm(uint8_t *V, uint8_t *Key,
|
|||||||
|
|
||||||
(*reseed_counter)++;
|
(*reseed_counter)++;
|
||||||
|
|
||||||
free(additional_input);
|
|
||||||
free(temp);
|
|
||||||
return "Success";
|
return "Success";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,18 +753,19 @@ int main() {
|
|||||||
|
|
||||||
// 需要生成的比特串长度
|
// 需要生成的比特串长度
|
||||||
printf("Enter the length of the bit string to be generated(bit): ");
|
printf("Enter the length of the bit string to be generated(bit): ");
|
||||||
scanf("%ld", &returned_bits_len);
|
// scanf("%ld", &returned_bits_len);
|
||||||
// returned_bits_len = 128;
|
returned_bits_len = 128;
|
||||||
|
|
||||||
// 需要生成的比特串个数
|
// 需要生成的比特串个数
|
||||||
printf("Enter the number of the bit string to be generated: ");
|
printf("Enter the number of the bit string to be generated: ");
|
||||||
scanf("%ld", &returned_bits_num);
|
// scanf("%ld", &returned_bits_num);
|
||||||
// returned_bits_num = 1000;
|
returned_bits_num = 1000;
|
||||||
|
|
||||||
// char *filename; filename 未分配内存
|
// char *filename; filename 未分配内存
|
||||||
char filename[100]; // 假设文件名长度不超过 99 个字符
|
char filename[100]; // 假设文件名长度不超过 99 个字符
|
||||||
printf("Enter the name of the saved file: ");
|
printf("Enter the name of the saved file: ");
|
||||||
scanf("%s", filename);
|
// scanf("%s", filename);
|
||||||
|
strcpy(filename, "1.txt");
|
||||||
|
|
||||||
// 生成的比特串保存在文本文件中
|
// 生成的比特串保存在文本文件中
|
||||||
FILE *file = fopen(filename, "w");
|
FILE *file = fopen(filename, "w");
|
||||||
@@ -826,6 +825,5 @@ int main() {
|
|||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
||||||
free(returned_bits);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user