Commit 30d4454e authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

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: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 0f089824
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment