s3:utils: smbget fix a memory leak
authorJones Syue <jonessyue@qnap.com>
Tue, 27 Jun 2023 09:19:59 +0000 (17:19 +0800)
committerVolker Lendecke <vl@samba.org>
Wed, 28 Jun 2023 07:02:34 +0000 (07:02 +0000)
commitafbed653526b572f7309e67ed742a76ef7b2b8ec
treefb0bb502dd76172bf52c307e3869c285fab9d8f3
parentb0524830aaf0ccf7dc2efbe66d2bf38b509c0143
s3:utils: smbget fix a memory leak

Using smbget to download files recursively (-R).

If smbget found that a file is already existed in the destination,
smbget would said 'File exists', return early, and 'newname' allocated
memory is never freed, this is found by valgrind.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15403

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jun 28 07:02:34 UTC 2023 on atb-devel-224
source3/utils/smbget.c