adk/tools/pkgmaker: Fix memleak in toupperstr()
commit316ba77dcdadd9599d98d3b66cd8440fd4a1eaac
authorPhil Sutter <phil@nwl.cc>
Mon, 28 Nov 2022 00:46:13 +0000 (28 01:46 +0100)
committerWaldemar Brodkorb <wbx@openadk.org>
Mon, 28 Nov 2022 07:27:09 +0000 (28 08:27 +0100)
tree1557ff6d7730894d0cf8481748fd26bc762e7067
parent6794a3dd815affd9a5e9610323164c464b93fad2
adk/tools/pkgmaker: Fix memleak in toupperstr()

The function allocated a fresh buffer upon every call but callers didn't
care to free the returned value.

To solve this in a most simple way, make the function non-reentrant,
returning a pointer to a local, statically allocated buffer which is
being overwritten upon each consecutive call.

Signed-off-by: Phil Sutter <phil@nwl.cc>
adk/tools/pkgmaker.c