canonicalize-lgpl: fix memory leak
commit5aca1898c9f62370142920be91992d4efe72bb7b
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 Nov 2020 07:37:57 +0000 (22 23:37 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 Nov 2020 07:39:13 +0000 (22 23:39 -0800)
treebc63ae26d00d43b2effde3f3701561204abc2345
parent2918d4a199cde71cecd0bab865954c3decd2f16f
canonicalize-lgpl: fix memory leak

* lib/canonicalize-lgpl.c (__realpath): Fix unlikely memory leak,
which could have occurred if BUF was so large that malloc was
called.  Do this by allocating EXTRA_BUF and BUF at the same time;
this eliminates the need to free BUF separately.
ChangeLog
lib/canonicalize-lgpl.c