[patch] Fix memory leak in the module loader

Arjan van de Ven arjan at infradead.org
Tue Feb 12 10:52:05 PST 2008


This one is funny; all the failure paths were very diligent in freeing the "fullpath"
temporary string, but.. the sucess case was not. All the content only got strdup()d
so it's not live memory anymore.

--- xserver/hw/xfree86/loader/loadmod.c.org	2008-02-11 11:48:02.000000000 +0100
+++ xserver/hw/xfree86/loader/loadmod.c	2008-02-11 11:50:12.000000000 +0100
@@ -182,6 +182,7 @@ InitPathList(const char *path)
     }
     if (list)
 	list[n] = NULL;
+    xfree(fullpath);
     return list;
 }
 


-- 
If you want to reach me at my work email, use arjan at linux.intel.com
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org



More information about the xorg mailing list