From: Mike Frysinger <vapier@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] hwdb: drop useless line freeing
Date: Mon, 02 Jan 2012 21:00:57 +0000 [thread overview]
Message-ID: <1325538057-6652-1-git-send-email-vapier@gentoo.org> (raw)
getline() takes care of extending the buffer as needed, so no point in
constantly freeing it before every call.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
udev/udev-builtin-hwdb.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/udev/udev-builtin-hwdb.c b/udev/udev-builtin-hwdb.c
index e38c6b9..b6af4b6 100644
--- a/udev/udev-builtin-hwdb.c
+++ b/udev/udev-builtin-hwdb.c
@@ -101,11 +101,6 @@ static int lookup_vid_pid(const char *database,
for (;;) {
size_t n;
- if (line) {
- free(line);
- line = NULL;
- }
-
if (getline(&line, &n, f) < 0)
break;
--
1.7.6.1
next reply other threads:[~2012-01-02 21:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-02 21:00 Mike Frysinger [this message]
2012-01-02 21:49 ` [PATCH] hwdb: drop useless line freeing 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=1325538057-6652-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--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