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:38 +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/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 939cb6cbf0ff1cd4e76e2c819ffc2e178e241bbd..d77d174c840c058c89430a7bbdf85f1850afbf2a 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.027026 seconds and 4 git commands to generate.