btrfsprogs/Plug-Memory-leak-in-find_and_setup_log_root.patch
David Sterba db07609875 - btrfs-progs-fix-open_ctree_usage_segfaults.patch: fix
segfaults from bnc#710486 due to unchecked usage of return
  value of open_ctree()
  [fixed compilation warnings]

- pull upstream, replace existing patches, spec update
- update 'restore' utility
  - lzo support
  - tools may now take earlies superblock when opening the fs
  - other fixes
- pull integration-20111030 branch
  - mkfs: force mkfs if desired
  - other fixes
- add btrfs-dump-super to mkinitrd
- other fixes
  - skip non-existent devices or without media
  - documentation updates
  - scrubbing single device
  - graceful error handling when opening fs fails

- updated mkinitrd script to scan devices before mount (bnc#727383)

OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=115
2011-12-14 23:25:51 +00:00

29 lines
895 B
Diff

commit a2fe2e1b978f724f53d025461e65adb4e030d043
Author: Dirk Mueller <dmueller@suse.de>
Date: Thu Dec 16 20:40:34 2010 +0100
[PATCH] Plug Memory leak in find_and_setup_log_root()
The error path forgets to free a previously allocated
memory structure.
Index: btrfs-progs-v0.19-116-g13eced9/disk-io.c
===================================================================
--- btrfs-progs-v0.19-116-g13eced9.orig/disk-io.c
+++ btrfs-progs-v0.19-116-g13eced9/disk-io.c
@@ -454,11 +454,13 @@ static int find_and_setup_log_root(struc
{
u32 blocksize;
u64 blocknr = btrfs_super_log_root(disk_super);
- struct btrfs_root *log_root = malloc(sizeof(struct btrfs_root));
+ struct btrfs_root *log_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));