Commit dce81504 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Ulrich Sibiller

FSWrap: fix potential leak in copy_string_list

If list_count is 0, dst would be allocated and leaked. Signed-off-by: 's avatarAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Reviewed-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 0f714869
......@@ -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);
......
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