From 30d4454e350ac7c5558d79fd09dfd49ffd415dd5 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 29 Nov 2011 23:56:57 -0800 Subject: Reject negative string counts in copy_string_list Silences parfait warning of a potential memory leak: Memory leak of pointer 'dst' allocated with malloc(length) at line 160 of FSWrap.c in function 'copy_string_list'. 'dst' allocated at line 145 with malloc(length). dst leaks when count <= 0 at line 154. Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/FSWrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/FSWrap.c') diff --git a/nx-X11/lib/X11/FSWrap.c b/nx-X11/lib/X11/FSWrap.c index 043e5dc3a..40a892f20 100644 --- a/nx-X11/lib/X11/FSWrap.c +++ b/nx-X11/lib/X11/FSWrap.c @@ -130,7 +130,7 @@ copy_string_list( char **string_list_ret, **list_src, **list_dst, *dst; int length, count; - if (string_list == NULL || list_count == 0) + if (string_list == NULL || list_count <= 0) return (char **) NULL; string_list_ret = (char **) Xmalloc(sizeof(char *) * list_count); -- cgit v1.2.3