Mailinglist Archive: opensuse-bugs (7819 mails)

< Previous Next >
[Bug 537633] New: btrfsprogs-0.19-3.4: memory leak
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Wed, 9 Sep 2009 03:16:48 -0600
  • Message-id: <bug-537633-21960@xxxxxxxxxxxxxxxxxxxxxxxx/>
http://bugzilla.novell.com/show_bug.cgi?id=537633


Summary: btrfsprogs-0.19-3.4: memory leak
Classification: openSUSE
Product: openSUSE 11.2
Version: Factory
Platform: All
OS/Version: openSUSE 11.1
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Basesystem
AssignedTo: bnc-team-screening@xxxxxxxxxxxxxxxxxxxxxx
ReportedBy: dcb314@xxxxxxxxxxx
QAContact: qa@xxxxxxx
Found By: ---


I just had a look at factory package btrfsprogs-0.19-3.4

For source code file btrfs-progs-0.19/disk-io.c
around line 430, function find_and_setup_log_root, is the following code

u64 blocknr = btrfs_super_log_root(disk_super);
struct btrfs_root *log_root = malloc(sizeof(struct btrfs_root));

if (blocknr == 0)
return 0;

If the return is taken, then the malloc causes a memory leak.
Suggest new code

u64 blocknr = btrfs_super_log_root(disk_super);
struct btrfs_root *log_root;

if (blocknr == 0)
return 0;

log_root = malloc(sizeof(struct btrfs_root));

--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >