wmaker: avoid allocating temporary memory in GetShortcutKey (Coverity #50115)
commit00f3ab0eaa754db65bd85c8a7183b1877442e4d0
authorChristophe CURIS <christophe.curis@free.fr>
Sat, 15 Nov 2014 18:40:36 +0000 (15 19:40 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 23 Nov 2014 22:42:19 +0000 (23 22:42 +0000)
tree4a4e479c5798c32821c32563c027065f59dfe7de
parent894d3e89bfeaa628e4d4a8a7f6707cc9582f4535
wmaker: avoid allocating temporary memory in GetShortcutKey (Coverity #50115)

As pointed by Coverity, the function GetShortcutKey was allocating memory
for temporary operation, and did not free it in the end.

Because it participates in memory fragmentation and it is not really
efficient, this patch removes the allocation and uses a local storage on
the stack, and replaces wstrappend in favour of a fast string build.

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