diff options
author | Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> | 2011-03-24 14:17:44 +0200 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> | 2011-04-13 11:05:59 +0300 |
commit | 396e5a452a59c1f121220ba72167b720a863b30f (patch) | |
tree | 586bbf57f021e3f6eb87597d7c423248490d81a9 | |
parent | 1a944260182bb552b954d69f6355c2760d4415df (diff) |
FSWrap: fix potential leak in copy_string_list
If list_count is 0, dst would be allocated and leaked.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/FSWrap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/FSWrap.c b/src/FSWrap.c index a9470936..94d94fbe 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); |