memzap

replay memory writes
git clone git://git.2f30.org/memzap.git
Log | Files | Refs | README | LICENSE

commit c62300609a6eeb8e01a9caf0800b831887d861a6
parent c9da72cae72f1957d24d985aaf27a3cbbf61548c
Author: sin <sin@2f30.org>
Date:   Sun Mar  3 21:40:22 +0000

mdiff: Provide and use free_mdiff_region()

Diffstat:
mdiff.c | 6++++++
mdiffdump.c | 2+-
proto.h | 1+
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/mdiff.c b/mdiff.c @@ -166,3 +166,9 @@ mdiff_append_rdiff(int fd, struct mem_region_diff *rdiff) return 0; } + +void +free_mdiff_region(struct mdiff_region *mdiff) +{ + free(mdiff); +} diff --git a/mdiffdump.c b/mdiffdump.c @@ -31,7 +31,7 @@ main(int argc, char *argv[]) for (j = 0; j < mdiff->len; j++) putchar(p[j]); putchar('\n'); - free(mdiff); + free_mdiff_region(mdiff); } close_mdiff(fd); return 0; diff --git a/proto.h b/proto.h @@ -167,5 +167,6 @@ int mdiff_start_diff(int fd); struct mdiff_region *mdiff_read_diff(int fd, struct mdiff_hdr *hdr, uint32_t region); int mdiff_append_rdiff(int fd, struct mem_region_diff *rdiff); +void free_mdiff_region(struct mdiff_region *mdiff); #endif