23 Sep
2014
23 Sep
'14
2 p.m.
On Tuesday 23 September 2014 17:20:35 Hu Tao wrote:
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> --- daemon/inotify.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
While I'd personally get rid of PATH_MAX at all, I understand the Linux inotify implementation relies on it...
diff --git a/daemon/inotify.c b/daemon/inotify.c index 36e5ede..b847b7d 100644 --- a/daemon/inotify.c +++ b/daemon/inotify.c @@ -309,7 +309,7 @@ do_inotify_files (void) unsigned int i; FILE *fp = NULL; guestfs_int_inotify_event_list *events; - char buf[PATH_MAX]; + char *buf = NULL;
Make it CLEANUP_FREE, so you don't need to manually free it later (and gets freed in every exit point of the function). -- Pino Toscano