Fix: save: leak of configuration file fd
[lttng-tools.git] / src / bin / lttng-sessiond / save.c
index c4abf813c341ae77718f8151808b5f75c1f54b18..c3db2882ad589316ac15760d89ecd5439ae71352 100644 (file)
@@ -960,8 +960,8 @@ int save_ust_context(struct config_writer *writer,
                        context_type_string = get_ust_context_type_string(
                                ctx->ctx.ctx);
                        if (!context_type_string) {
-                               ERR("Unsupported UST context type.")
-                                       ret = LTTNG_ERR_INVALID;
+                               ERR("Unsupported UST context type.");
+                               ret = LTTNG_ERR_INVALID;
                                goto end;
                        }
 
@@ -1967,6 +1967,13 @@ end:
                }
        }
 
+       if (file_opened) {
+               ret = close(fd);
+               if (ret) {
+                       PERROR("Closing XML session configuration");
+               }
+       }
+
        return ret;
 }
 
This page took 0.024921 seconds and 4 git commands to generate.