X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fconf.c;h=cdd264a5d11a3246e4430a3acce5cf354a68e731;hb=8936c33a1a322904bd631caff22358a0bb791cf5;hp=d326378f7a57f5ecc42168eb9f7a477e244d0017;hpb=db7586006bc1a2b9057a2c108bf1e7d20fd6903f;p=lttng-tools.git 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: