From ff7a101bf51b227a5b737ccd7fa9d8e9def28b761da492d978fbb81931ee2476 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 26 Mar 2010 15:47:29 +0000 Subject: [PATCH] Accepting request 35792 from filesystems Copy from filesystems/btrfsprogs based on submit request 35792 from user dirkmueller OBS-URL: https://build.opensuse.org/request/show/35792 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/btrfsprogs?expand=0&rev=10 --- ...mory-leak-in-find_and_setup_log_root.patch | 33 +++++++++++++++++++ btrfsprogs.changes | 5 +++ btrfsprogs.spec | 4 ++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0001-Plug-Memory-leak-in-find_and_setup_log_root.patch diff --git a/0001-Plug-Memory-leak-in-find_and_setup_log_root.patch b/0001-Plug-Memory-leak-in-find_and_setup_log_root.patch new file mode 100644 index 0000000..448055d --- /dev/null +++ b/0001-Plug-Memory-leak-in-find_and_setup_log_root.patch @@ -0,0 +1,33 @@ +From 4145e527ba81c288aa081073e1ce68fa0ceb4107 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +Date: Fri, 26 Mar 2010 11:25:43 +0100 +Subject: [PATCH] Plug Memory leak in find_and_setup_log_root() + +The error path forgets to free a previously allocated +memory structure. +--- + disk-io.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/disk-io.c b/disk-io.c +index addebe1..eab3f0b 100644 +--- a/disk-io.c ++++ b/disk-io.c +@@ -422,12 +422,13 @@ static int find_and_setup_log_root(struct btrfs_root *tree_root, + struct btrfs_super_block *disk_super) + { + u32 blocksize; ++ struct btrfs_root *log_root; + u64 blocknr = btrfs_super_log_root(disk_super); +- struct btrfs_root *log_root = malloc(sizeof(struct btrfs_root)); + + if (blocknr == 0) + return 0; + ++ log_root = malloc(sizeof(struct btrfs_root)); + blocksize = btrfs_level_size(tree_root, + btrfs_super_log_root_level(disk_super)); + +-- +1.7.0.2 + diff --git a/btrfsprogs.changes b/btrfsprogs.changes index 1dd6632..7e2c9ed 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Mar 26 13:24:15 CET 2010 - dmueller@suse.de + +- fix memory leak (bnc#537633) + ------------------------------------------------------------------- Thu Mar 4 22:48:17 CET 2010 - jeffm@suse.de diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 4e63f04..871975c 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -20,7 +20,7 @@ Name: btrfsprogs Url: http://oss.oracle.com/~mason/btrfs/ Version: 0.19 -Release: 6 +Release: 7 Summary: Btrfs File System Utilities License: GNU General Public License (GPL) Group: System/Filesystems @@ -31,6 +31,7 @@ Patch1: 0001-used-space-accounting-fix-for-the-converter.patch Patch2: 0002-btrfsctl-add-snapshot-subvolume-destroy-ioctl.patch Patch3: 0003-btrfsck-check-root-back-forward-references.patch Patch4: 0004-Add-btrfs-map-logical-program-to-map-and-read-logica.patch +Patch5: 0001-Plug-Memory-leak-in-find_and_setup_log_root.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libacl-devel libext2fs-devel libuuid-devel zlib-devel @@ -45,6 +46,7 @@ file systems. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build make %{?jobs:-j%jobs} CFLAGS="%{optflags}" all convert