Fixed double-malloc

This commit is contained in:
niansa 2021-09-18 13:21:27 +00:00
parent ab5a625706
commit 0fa3642135

View file

@ -56,7 +56,7 @@ int main(int argc, char **argv) {
// Get array of files and commands
libcatch_behavior = 0;
struct fcmd_pair *assocs = (struct fcmd_pair *)(argv + 1);
struct fcmdwatcher_pair *assocs_watches = malloc((sizeof(struct fcmdwatcher_pair) * ((argc - 1) / 2)) + 1);
struct fcmdwatcher_pair *assocs_watches;
struct fcmdwatcher_pair *watcherpair_ptr;
CATCH(assocs_watches = malloc((sizeof(struct fcmdwatcher_pair) * ((argc - 1) / 2)) + 1));
// Initlialise inotify further while checking if all files are actual files