From 00f368638a00aa0a823d5ed8b077af74339b687b Mon Sep 17 00:00:00 2001 From: Daniel Thibault Date: Tue, 24 Jan 2012 17:32:47 -0500 Subject: [PATCH] Fix file descriptor leak and typo in conf.c Signed-off-by: David Goulet --- src/bin/lttng/conf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng/conf.c b/src/bin/lttng/conf.c index d326378f7..cdd264a5d 100644 --- a/src/bin/lttng/conf.c +++ b/src/bin/lttng/conf.c @@ -171,7 +171,7 @@ char *config_read_session_name(char *path) fp = open_config(path, "r"); if (fp == NULL) { ERR("Can't find valid lttng config %s/.lttngrc", path); - MSG("Did you create a session? (lttng create )"); + MSG("Did you create a session? (lttng create )"); goto error; } @@ -180,7 +180,7 @@ char *config_read_session_name(char *path) if ((ret = fscanf(fp, "%[^'=']=%s\n", var, session_name)) != 2) { if (ret == -1) { ERR("Missing session=NAME in config file."); - goto error; + goto error_close; } continue; } @@ -190,6 +190,7 @@ char *config_read_session_name(char *path) } } +error_close: fclose(fp); error: -- 2.34.1