Loading fs_mgr/fs_mgr_fstab.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -654,12 +654,13 @@ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) } } for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) { for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) { // copy the pointer directly *without* malloc and memcpy // Copy the structs by assignment. a->recs[i] = b->recs[j]; a->recs[i] = b->recs[j]; } } // Frees up b, but don't free b->recs[X] to make sure they are // We can't call fs_mgr_free_fstab because a->recs still references the // accessible through a->recs[X]. // memory allocated by strdup. free(b->recs); free(b->fstab_filename); free(b->fstab_filename); free(b); free(b); Loading Loading
fs_mgr/fs_mgr_fstab.cpp +4 −3 Original line number Original line Diff line number Diff line Loading @@ -654,12 +654,13 @@ static struct fstab *in_place_merge(struct fstab *a, struct fstab *b) } } for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) { for (int i = a->num_entries, j = 0; i < total_entries; i++, j++) { // copy the pointer directly *without* malloc and memcpy // Copy the structs by assignment. a->recs[i] = b->recs[j]; a->recs[i] = b->recs[j]; } } // Frees up b, but don't free b->recs[X] to make sure they are // We can't call fs_mgr_free_fstab because a->recs still references the // accessible through a->recs[X]. // memory allocated by strdup. free(b->recs); free(b->fstab_filename); free(b->fstab_filename); free(b); free(b); Loading