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:42:31 +0000 (11:42 -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/session-config.h

index 9ac7712cb114968fdb8c3c4605a4f2f10419037b..1a879b21429892e1f1af1465af9c790b5f7270b5 100644 (file)
@@ -2053,6 +2053,13 @@ end:
                }
        }
 
+       if (file_opened) {
+               ret = close(fd);
+               if (ret) {
+                       PERROR("Closing XML session configuration");
+               }
+       }
+
        return ret;
 }
 
index c6439f756fc431c636a4383c589d6d43c929dff0..f48ff74ae6f54384279115c424105c76fc8cce38 100644 (file)
@@ -85,8 +85,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.035581 seconds and 4 git commands to generate.