From f6940be7825755d77ade4cd42231aab9e3580623 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 11 Jul 2013 00:35:01 +0200 Subject: [PATCH] shutdown: avoid malloc() if we can --- src/core/shutdown.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/core/shutdown.c b/src/core/shutdown.c index fe7a0739db8..10a52bd1175 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -145,13 +145,7 @@ int main(int argc, char *argv[]) { size_t l; FOREACH_WORD_QUOTED(w, l, line, state) { - _cleanup_free_ char *word; - - word = strndup(w, l); - if (!word) - break; - - if (streq(word, "quiet")) { + if (l == 5 && memcmp(w, "quiet", 5) == 0) { log_set_max_level(LOG_WARNING); break; }