If list_count is 0, dst would be allocated and leaked.

Signed-off-by: Ander Conselvan de Oliveira 
<[email protected]>
---
 src/FSWrap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/FSWrap.c b/src/FSWrap.c
index a947093..94d94fb 100644
--- a/src/FSWrap.c
+++ b/src/FSWrap.c
@@ -131,7 +131,7 @@ copy_string_list(
     char **string_list_ret, **list_src, **list_dst, *dst;
     int length, count;
 
-    if (string_list == NULL)
+    if (string_list == NULL || list_count == 0)
        return (char **) NULL;
 
     string_list_ret = (char **) Xmalloc(sizeof(char *) * list_count);
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to