diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-08-17 11:45:17 +0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2014-08-18 14:39:10 -0400 |
commit | b3dd1b8c295636e64ceb14cdc4db6420d7319e38 (patch) | |
tree | e8455dfc57b74258a99088394bf2c6ba9a57ed40 /include/monitor | |
parent | 2928207ac1bb2751a1554ea0f9a9641179f51488 (diff) |
monitor: fix use after free
The function monitor_fdset_dup_fd_find_remove() references member of
'mon_fdset' which - when remove flag is set - may be freed in function
monitor_fdset_cleanup().
remove is set by monitor_fdset_dup_fd_remove which in practice
does not need the returned value, so make it void,
and return -1 from monitor_fdset_dup_fd_find_remove.
Reported-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'include/monitor')
-rw-r--r-- | include/monitor/monitor.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 3d6929d6cd..78a5fc8197 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -64,7 +64,7 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, Error **errp); int monitor_fdset_get_fd(int64_t fdset_id, int flags); int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd); -int monitor_fdset_dup_fd_remove(int dup_fd); +void monitor_fdset_dup_fd_remove(int dup_fd); int monitor_fdset_dup_fd_find(int dup_fd); #endif /* !MONITOR_H */ |