WUtil: Avoid memory leak and misbehaviour on internal function 'getuserhomedir'
commit3c2fc82b6ee9c451a87e2d3ade2983f9dd1e3999
authorChristophe CURIS <christophe.curis@free.fr>
Sun, 9 Jun 2013 14:28:48 +0000 (9 16:28 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 9 Jun 2013 15:51:16 +0000 (9 16:51 +0100)
tree6450189771720d16baa08264ce777716fea3b1dd
parent7889c50c3687f359d94a2a7517e9cdd679090554
WUtil: Avoid memory leak and misbehaviour on internal function 'getuserhomedir'

If the function was called more than once with different usernames
it would always return the path for the user on the first call,
which is not what would be expected.

Furthermore, if the function succeeds it allocated memory to save
this path but it was never freed.

The good thing is that the use case for this function is so rare
that it is improbable it was ever called, which explains why it
was never seen.

The new code always behaves as expected, and does not allocate
memory anymore to avoid wasting time and memory for such small
things, which is acceptable because this function is local.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
WINGs/findfile.c