Fix file descriptor leak and typo in conf.c
authorDaniel Thibault <daniel.thibault@drdc-rddc.gc.ca>
Tue, 24 Jan 2012 22:32:47 +0000 (17:32 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 24 Jan 2012 22:35:21 +0000 (17:35 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/conf.c

index d326378f7a57f5ecc42168eb9f7a477e244d0017..cdd264a5d11a3246e4430a3acce5cf354a68e731 100644 (file)
@@ -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 <my_sesion>)");
+               MSG("Did you create a session? (lttng create <my_session>)");
                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:
This page took 0.025283 seconds and 4 git commands to generate.