]> git.ipfire.org Git - thirdparty/elfutils.git/commit
ar: Replace one alloca use by xmalloc
authorMark Wielaard <mark@klomp.org>
Tue, 30 Apr 2024 14:39:17 +0000 (16:39 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 12 May 2024 21:48:39 +0000 (23:48 +0200)
commit3c71cab7c5bfba0549d0a1716e7061d07eafd794
treec30e25e52182a080355b5df9afc53eb32b79c0b2
parent1df8caf4026b46604e55f1201942ffc01cb5676d
ar: Replace one alloca use by xmalloc

This alloca use is inside a lexical block and is used to replace one
element of argv. Use a function local variable, xmalloc and free to
make memory usage pattern more clear.

    * src/ar.c (main): Move newp char pointer declaration up.
    Use xmalloc to allocate space. free at end of main.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ar.c