Skip to content

Commit

Permalink
fixes to freeing sync list
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielle Sikich committed Jun 15, 2017
1 parent ce8f525 commit 2f8e6d4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/dcmp/dcmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,8 @@ static void dcmp_strmap_compare(mfu_flist src_list,
mfu_flist dst_compare_list = mfu_flist_subset(dst_list);

/* remove and copy lists for sync option */
mfu_flist dst_remove_list = MFU_FLIST_NULL;
mfu_flist src_cp_list = MFU_FLIST_NULL;
mfu_flist dst_remove_list = NULL;
mfu_flist src_cp_list = NULL;

/* create dst remove list if sync option is on */
if (mfu_copy_opts->do_sync) {
Expand Down Expand Up @@ -1219,8 +1219,14 @@ static void dcmp_strmap_compare(mfu_flist src_list,
}

/* free lists used for copying and removing files in sync option */
mfu_flist_free(&src_cp_list);
mfu_flist_free(&dst_remove_list);
/* TODO: fix MFU_FLIST_NULL so that we don't have to do these NULL
* checks here */
if (src_cp_list != NULL) {
mfu_flist_free(&src_cp_list);
}
if (dst_remove_list != NULL) {
mfu_flist_free(&dst_remove_list);
}

/* free the compare flists */
mfu_flist_free(&dst_compare_list);
Expand Down

0 comments on commit 2f8e6d4

Please sign in to comment.