Fix: save: leak of configuration file fd
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 18 Oct 2016 22:09:53 +0000 (18:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 19 Oct 2016 15:43:45 +0000 (11:43 -0400)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/save.c
src/common/config/config.h

index 77b75e363ac81da55c2b9be7a55bd2dbbd261417..c3db2882ad589316ac15760d89ecd5439ae71352 100644 (file)
@@ -1967,6 +1967,13 @@ end:
                }
        }
 
+       if (file_opened) {
+               ret = close(fd);
+               if (ret) {
+                       PERROR("Closing XML session configuration");
+               }
+       }
+
        return ret;
 }
 
index 2fed612a1cfbd5783891ec16e99808dc386e3645..1cf0c2a96ebfcfa64d2dd46a860e16236d9b174e 100644 (file)
@@ -78,8 +78,8 @@ int config_parse_value(const char *value);
 /*
  * Create an instance of a configuration writer.
  *
- * fd_output File to which the XML content must be written. The file will be
- * closed once the config_writer has been destroyed.
+ * fd_output File to which the XML content must be written. fd_output is
+ * owned by the caller.
  *
  * indent If other than 0 the XML will be pretty printed
  * with indentation and newline.
This page took 0.027708 seconds and 4 git commands to generate.