[linux-vdagent PATCH v1] uinput: avoid double free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 4835df0b642dfc963e7 fixed a leak but by not setting pointer to
NULL it could lead to double free.

Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1262635
---
 src/vdagentd-uinput.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/vdagentd-uinput.c b/src/vdagentd-uinput.c
index 1ce9918..446c0ed 100644
--- a/src/vdagentd-uinput.c
+++ b/src/vdagentd-uinput.c
@@ -77,8 +77,10 @@ void vdagentd_uinput_destroy(struct vdagentd_uinput **uinputp)
     if (uinput->fd != -1)
         close(uinput->fd);
 
-    if (uinput->screen_info != NULL)
+    if (uinput->screen_info != NULL) {
         free(uinput->screen_info);
+        uinput->screen_info = NULL;
+    }
 
     free(uinput);
     *uinputp = NULL;
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]