mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
Merge pull request #1099 from urbit/fix-mount-sync
fix (my own) use-after-free in unix dir/file watch
This commit is contained in:
commit
5bb9cacf6d
@ -371,6 +371,8 @@ _unix_scan_mount_point(u3_umon* mon_u)
|
||||
_unix_watch_file(fil_u, &mon_u->dir_u, pax_c);
|
||||
}
|
||||
}
|
||||
|
||||
free(pax_c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -590,7 +592,8 @@ _unix_watch_file(u3_ufil* fil_u, u3_udir* par_u, c3_c* pax_c)
|
||||
|
||||
fil_u->dir = c3n;
|
||||
fil_u->dry = c3n;
|
||||
fil_u->pax_c = pax_c;
|
||||
fil_u->pax_c = c3_malloc(1 + strlen(pax_c));
|
||||
strcpy(fil_u->pax_c, pax_c);
|
||||
fil_u->par_u = par_u;
|
||||
fil_u->nex_u = NULL;
|
||||
fil_u->mug_w = 0;
|
||||
@ -627,7 +630,8 @@ _unix_watch_dir(u3_udir* dir_u, u3_udir* par_u, c3_c* pax_c)
|
||||
|
||||
dir_u->dir = c3y;
|
||||
dir_u->dry = c3n;
|
||||
dir_u->pax_c = pax_c;
|
||||
dir_u->pax_c = c3_malloc(1 + strlen(pax_c));
|
||||
strcpy(dir_u->pax_c, pax_c);
|
||||
dir_u->par_u = par_u;
|
||||
dir_u->nex_u = NULL;
|
||||
dir_u->kid_u = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user