WINGs: removed unnecessary size checks in WMGetBrowserPaths
commit0c659c161858cc9c6bd03c7b9b06e1dcf35075b5
authorChristophe CURIS <christophe.curis@free.fr>
Sat, 15 Nov 2014 18:40:33 +0000 (15 19:40 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 23 Nov 2014 22:42:18 +0000 (23 22:42 +0000)
treebd1d90a0a67df1e36e0246ffbd72b0c3e5138364
parent082de93ca0b86451cde37ba73f9f46d9f81fcdaa
WINGs: removed unnecessary size checks in WMGetBrowserPaths

The function is building strings from the directory names into an allocated
buffer, but the function took time first to calculate the exact size needed
for the resulting string, so the check on wstrlcat's result will never
fail.

As we still use wstrlcat it is not possible to overrun the buffer, we would
just return a truncated string in the list instead of return no list at all
but the case where it would happen is impossible.

This should fix Coverity #50111 (Resource leak) which was present in the
code of one of the related early return.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
WINGs/wbrowser.c