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>
Tue, 17 May 2016 18:20:46 +0000 (14:20 -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 02903becdab2ca4783b147d3e060063f1e460855..987a9dda352c4520eeee4815cc3bd4eee0ab6728 100644 (file)
@@ -348,6 +348,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;
@@ -355,6 +356,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.026653 seconds and 4 git commands to generate.