Fix NULL dereference in w32notify.c
* src/w32notify.c (start_watching): Return NULL instead of freed pointer. (add_watch): Fix NULL dereference.
This commit is contained in:
parent
1bfc7fd33d
commit
893829021b
1 changed files with 2 additions and 4 deletions
|
@ -350,6 +350,7 @@ start_watching (const char *file, HANDLE hdir, BOOL subdirs, DWORD flags)
|
||||||
xfree (dirwatch->io_info);
|
xfree (dirwatch->io_info);
|
||||||
xfree (dirwatch->watchee);
|
xfree (dirwatch->watchee);
|
||||||
xfree (dirwatch);
|
xfree (dirwatch);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
return dirwatch;
|
return dirwatch;
|
||||||
}
|
}
|
||||||
|
@ -412,10 +413,7 @@ add_watch (const char *parent_dir, const char *file, BOOL subdirs, DWORD flags)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((dirwatch = start_watching (file, hdir, subdirs, flags)) == NULL)
|
if ((dirwatch = start_watching (file, hdir, subdirs, flags)) == NULL)
|
||||||
{
|
CloseHandle (hdir);
|
||||||
CloseHandle (hdir);
|
|
||||||
dirwatch->dir = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dirwatch;
|
return dirwatch;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue