aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-29 23:56:57 -0800
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:25 +0200
commit30d4454e350ac7c5558d79fd09dfd49ffd415dd5 (patch)
treed575cb77d46c998e66f45eb4f6e9f1317ed10e88 /nx-X11
parent0f089824eedf91df21d1786abc2961247ba8efb7 (diff)
downloadnx-libs-30d4454e350ac7c5558d79fd09dfd49ffd415dd5.tar.gz
nx-libs-30d4454e350ac7c5558d79fd09dfd49ffd415dd5.tar.bz2
nx-libs-30d4454e350ac7c5558d79fd09dfd49ffd415dd5.zip
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 <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/FSWrap.c2
1 files changed, 1 insertions, 1 deletions
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);