summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-29 23:56:57 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-29 23:56:57 -0800
commit56448a626fc90bcf75a1fa2f4c294b0eb1f23bd6 (patch)
tree24584506595779cacb6f33f4695868fab9d9bedc
parentbf2d7c8c6d70539c72560b1921e18df2610acf29 (diff)
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>
-rw-r--r--src/FSWrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FSWrap.c b/src/FSWrap.c
index 45a2c34..910e602 100644
--- a/src/FSWrap.c
+++ b/src/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);