Fix: Free variables before strdup()
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 17 May 2016 18:08:00 +0000 (14:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 20 May 2016 20:38:05 +0000 (16:38 -0400)
Fixes coverity #1243047 and #1243050

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/lttng.c

index 9975a11465f46bc63e555f026e860d1ee93e6259..4bf914fc1da235a716e604bea11d69fe04695cac 100644 (file)
@@ -482,6 +482,7 @@ static int parse_args(int argc, char **argv)
                        opt_no_sessiond = 1;
                        break;
                case OPT_SESSION_PATH:
+                       free(opt_sessiond_path);
                        opt_sessiond_path = strdup(optarg);
                        if (!opt_sessiond_path) {
                                ret = -1;
@@ -489,6 +490,7 @@ static int parse_args(int argc, char **argv)
                        }
                        break;
                case OPT_RELAYD_PATH:
+                       free(opt_relayd_path);
                        opt_relayd_path = strdup(optarg);
                        if (!opt_relayd_path) {
                                ret = -1;
This page took 0.026375 seconds and 4 git commands to generate.