]> git.ipfire.org Git - thirdparty/libarchive.git/commit
cmdline: Use free+strdup instead of realloc+strcpy 3036/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 16 May 2026 13:25:53 +0000 (15:25 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 16 May 2026 13:25:53 +0000 (15:25 +0200)
commita4df51287e7fd91365b532398b8d912eea94ff6e
treead3b17264328773abae3f960481a349d4e105885
parent27b08f61da304afa8bc75901117c9a077e41c5bb
cmdline: Use free+strdup instead of realloc+strcpy

The cmdline_set_path function contains logic to reallocate memory of
command path and copy a new value into it.

Inline a simpler free+strdup alternative into __archive_cmdline_parse.
Since the function is always called with empty data, free could be
removed as well. I've kept it that way just to make sure that it's 100 %
compatible with previous code.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_cmdline.c