Blame SOURCES/0453-fstab-generator-fix-memleak.patch

17b0f1
From c6b00287b8847c550ab75947f52e37282632a2f3 Mon Sep 17 00:00:00 2001
17b0f1
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
17b0f1
Date: Sat, 2 May 2015 12:01:28 -0500
17b0f1
Subject: [PATCH] fstab-generator: fix memleak
17b0f1
17b0f1
filtered was used to store an allocated string twice. The first allocation was
17b0f1
thus lost. The string is not needed for anything, so simply skip the allocation.
17b0f1
17b0f1
Fixup for deb0a77cf0b409141c4.
17b0f1
17b0f1
(cherry picked from commit 336b5c615e9c101476784b32df1b86aaeac96431)
17b0f1
Related: #1354410
17b0f1
---
17b0f1
 src/fstab-generator/fstab-generator.c | 6 +++---
17b0f1
 1 file changed, 3 insertions(+), 3 deletions(-)
17b0f1
17b0f1
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
17b0f1
index a943393b04..32aca22444 100644
17b0f1
--- a/src/fstab-generator/fstab-generator.c
17b0f1
+++ b/src/fstab-generator/fstab-generator.c
17b0f1
@@ -214,13 +214,13 @@ static int write_requires_mounts_for(FILE *f, const char *opts) {
17b0f1
         return 0;
17b0f1
 }
17b0f1
 
17b0f1
-static int write_idle_timeout(FILE *f, const char *where, const char *opts, char **filtered) {
17b0f1
+static int write_idle_timeout(FILE *f, const char *where, const char *opts) {
17b0f1
         _cleanup_free_ char *timeout = NULL;
17b0f1
         char timespan[FORMAT_TIMESPAN_MAX];
17b0f1
         usec_t u;
17b0f1
         int r;
17b0f1
 
17b0f1
-        r = fstab_filter_options(opts, "x-systemd.idle-timeout\0", NULL, &timeout, filtered);
17b0f1
+        r = fstab_filter_options(opts, "x-systemd.idle-timeout\0", NULL, &timeout, NULL);
17b0f1
         if (r < 0)
17b0f1
                 return log_warning_errno(r, "Failed to parse options: %m");
17b0f1
         if (r == 0)
17b0f1
@@ -398,7 +398,7 @@ static int add_mount(
17b0f1
                         "Where=%s\n",
17b0f1
                         where);
17b0f1
 
17b0f1
-                r = write_idle_timeout(f, where, opts, &filtered);
17b0f1
+                r = write_idle_timeout(f, where, opts);
17b0f1
                 if (r < 0)
17b0f1
                         return r;
17b0f1