!166 [sync] PR-165: fix memleak in vgchange
From: @openeuler-sync-bot Reviewed-by: @swf504 Signed-off-by: @swf504
This commit is contained in:
commit
6201ec7f54
28
0019-fix-memleak-in-vgchange.patch
Normal file
28
0019-fix-memleak-in-vgchange.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 7ec97ed5f2b95585eb1538ee6edeedb7275101eb Mon Sep 17 00:00:00 2001
|
||||
From: Zdenek Kabelac <zkabelac@redhat.com>
|
||||
Date: Wed, 12 Jul 2023 14:15:41 +0200
|
||||
Subject: [PATCH] cov: fix memleak in vgchange
|
||||
|
||||
Release allocated vgname from get_single_vgname_cmd_arg()
|
||||
when it is not returned via *vgname_ret.
|
||||
|
||||
---
|
||||
tools/vgchange.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/tools/vgchange.c b/tools/vgchange.c
|
||||
index 63861b5..7a53a7f 100644
|
||||
--- a/tools/vgchange.c
|
||||
+++ b/tools/vgchange.c
|
||||
@@ -863,6 +863,8 @@ static int _vgchange_autoactivation_setup(struct cmd_context *cmd,
|
||||
*flags &= ~READ_WITHOUT_LOCK;
|
||||
cmd->can_use_one_scan = 0;
|
||||
}
|
||||
+
|
||||
+ free(vgname);
|
||||
return 1;
|
||||
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
Name: lvm2
|
||||
Version: 2.03.21
|
||||
Release: 8
|
||||
Release: 9
|
||||
Epoch: 8
|
||||
Summary: Tools for logical volume management
|
||||
License: GPLv2+ and LGPLv2.1 and BSD
|
||||
@ -67,6 +67,7 @@ Patch15: 0015-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch
|
||||
Patch16: 0016-dm-event-release-buffer-on-dm_event_get_version.patch
|
||||
Patch17: 0017-clean-up-group-struct-in-_stats_create_group-error-path.patch
|
||||
Patch18: 0018-do-not-pass-empty-string-in-callback.patch
|
||||
Patch19: 0019-fix-memleak-in-vgchange.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
@ -493,6 +494,9 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Thu May 9 2024 yanshuai <yanshuai@kylinos.cn> - 8:2.03.21-9
|
||||
- cov: fix memleak in vgchange
|
||||
|
||||
* Tue May 7 2024 yanshuai <yanshuai@kylinos.cn> - 8:2.03.21-8
|
||||
- pool: do not pass empty string in callback
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user