projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bfc7fd
)
Fix NULL dereference in w32notify.c
author
Stefan Kangas
<stefankangas@gmail.com>
Sat, 13 Jan 2024 09:20:41 +0000
(10:20 +0100)
committer
Stefan Kangas
<stefankangas@gmail.com>
Sat, 13 Jan 2024 09:21:41 +0000
(10:21 +0100)
* src/w32notify.c (start_watching): Return NULL instead of freed
pointer.
(add_watch): Fix NULL dereference.
src/w32notify.c
patch
|
blob
|
history
diff --git
a/src/w32notify.c
b/src/w32notify.c
index 9f8a62a1daaa951c81e6224aef827eb61602b7c0..c93e8796fe27768d0ca42314f43886bd9170caca 100644
(file)
--- a/
src/w32notify.c
+++ b/
src/w32notify.c
@@
-350,6
+350,7
@@
start_watching (const char *file, HANDLE hdir, BOOL subdirs, DWORD flags)
xfree (dirwatch->io_info);
xfree (dirwatch->watchee);
xfree (dirwatch);
+ return NULL;
}
return dirwatch;
}
@@
-412,10
+413,7
@@
add_watch (const char *parent_dir, const char *file, BOOL subdirs, DWORD flags)
return NULL;
if ((dirwatch = start_watching (file, hdir, subdirs, flags)) == NULL)
- {
- CloseHandle (hdir);
- dirwatch->dir = NULL;
- }
+ CloseHandle (hdir);
return dirwatch;
}