From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] udevd: fix memory leak
Date: Thu, 23 Oct 2008 09:27:36 +0000 [thread overview]
Message-ID: <49004388.1050705@tuffmail.co.uk> (raw)
Re: b99028c96307e729303be8f6750418979a7488b9 shrink struct udev_event
TEST 136: test multi matches 2
device '/devices/pci0000:00/0000:00:1d.7/usb5/5-2/5-2:1.0/tty/ttyACM0' expecting node 'right'
=15011=
=15011= 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
=15011= at 0x47F9AB8: malloc (vg_replace_malloc.c:207)
=15011= by 0x489CB5F: strdup (in /lib32/libc-2.7.so)
=15011= by 0x8050F40: udev_rules_apply_to_event (udev-rules.c:1973)
=15011= by 0x804A658: udev_event_execute_rules (udev-event.c:549)
=15011= by 0x805A636: main (test-udev.c:100)
add: ok
=15012=
=15012= 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
=15012= at 0x47F1AB8: malloc (vg_replace_malloc.c:207)
=15012= by 0x4898B5F: strdup (in /lib32/libc-2.7.so)
=15012= by 0x8050F40: udev_rules_apply_to_event (udev-rules.c:1973)
=15012= by 0x804A9DF: udev_event_execute_rules (udev-event.c:658)
=15012= by 0x805A636: main (test-udev.c:100)
remove: ok
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 19ee06d..55e27b7 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -1970,6 +1970,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
count = util_replace_chars(name_str, ALLOWED_CHARS_FILE);
if (count > 0)
info(event->udev, "%i character(s) replaced\n", count);
+ free(event->name);
event->name = strdup(name_str);
}
break;
next reply other threads:[~2008-10-23 9:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 9:27 Alan Jenkins [this message]
2008-10-23 9:34 ` [PATCH] udevd: fix memory leak Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49004388.1050705@tuffmail.co.uk \
--to=alan-jenkins@tuffmail.co.uk \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).