Skip to content

Commit

Permalink
fixed memory in binarydiff output
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Nov 25, 2024
1 parent 9fc283a commit 5bfccb2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/binarydiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ int reb_binary_diff(char* buf1, size_t size1, char* buf2, size_t size2, char** b
}else{
printf("%s",buf);
}
free(buf);
output_stream_reb_type(fd.dtype, buf1+pos1, field1.size, bufp);
#ifndef _WIN32
asprintf(&buf, "\033[0m\n---\n\033[32m> ");
Expand All @@ -266,6 +267,7 @@ int reb_binary_diff(char* buf1, size_t size1, char* buf2, size_t size2, char** b
}else{
printf("%s",buf);
}
free(buf);
output_stream_reb_type(fd.dtype, buf2+pos2, field2.size, bufp);
#ifndef _WIN32
asprintf(&buf, "\033[0m\n");
Expand All @@ -278,6 +280,7 @@ int reb_binary_diff(char* buf1, size_t size1, char* buf2, size_t size2, char** b
}else{
printf("%s",buf);
}
free(buf);
}
}
pos1 += field1.size;
Expand Down

0 comments on commit 5bfccb2

Please sign in to comment.