From d36306a560fd6d747e18ab22fc1279f4a373f43d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 27 Sep 2023 20:37:22 +0200 Subject: [PATCH] libmount: (tab) avoid leaking memory allocated in loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Weißschuh --- libmount/src/tab.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libmount/src/tab.c b/libmount/src/tab.c index 60bef8b2d1..c6be5369e3 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -1856,6 +1856,7 @@ int __mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_f if (!*p) tgt = tgt_prefix; /* target is '/' */ else { + free(tgt_buf); if (asprintf(&tgt_buf, "%s/%s", tgt_prefix, p) <= 0) { rc = -ENOMEM; goto done; -- 2.47.2