fix(basefile): made sure file_info.hash is null instead of random memory

This commit is contained in:
lisk77 2025-09-19 00:01:14 +02:00
parent 8831b267e5
commit 3e0a0d7057

View file

@ -266,8 +266,6 @@ int write_base_file_list(BaseFileBuffer* buffer, char* info_file) {
info->name, info->base_num, info->diff_num); info->name, info->base_num, info->diff_num);
} }
printf("%s\n", tmp);
FILE* fp = fopen(info_file, "wb"); FILE* fp = fopen(info_file, "wb");
if (!fp) { perror("ERROR: cannot open path in snapshot_tree!\n"); return 0; } if (!fp) { perror("ERROR: cannot open path in snapshot_tree!\n"); return 0; }
@ -316,6 +314,7 @@ FileInfoBuffer* basefilebuffer_to_fileinfobuffer(BaseFileBuffer* base_buffer) {
return NULL; return NULL;
} }
file_info.mode = st.st_mode; file_info.mode = st.st_mode;
file_info.hash = NULL;
if (!file_info_buffer_push(file_buffer, file_info)) { if (!file_info_buffer_push(file_buffer, file_info)) {
free(file_info.name); free(file_info.name);