Fix: Overwrite of ret in relay_recv_metadata
[lttng-tools.git] / src / bin / lttng-relayd / health-relayd.c
index 75149ba4b46526a0494bfea623b3115c676064d4..d34a376c53989dd314cf217c0da52e7d69f1a3e4 100644 (file)
@@ -49,6 +49,7 @@
 #include <common/compat/poll.h>
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/utils.h>
+#include <common/compat/getenv.h>
 
 #include "lttng-relayd.h"
 #include "health-relayd.h"
@@ -136,7 +137,7 @@ int parse_health_env(void)
 {
        const char *health_path;
 
-       health_path = getenv(LTTNG_RELAYD_HEALTH_ENV);
+       health_path = lttng_secure_getenv(LTTNG_RELAYD_HEALTH_ENV);
        if (health_path) {
                strncpy(health_unix_sock_path, health_path,
                        PATH_MAX);
@@ -150,7 +151,7 @@ static
 int setup_health_path(void)
 {
        int is_root, ret = 0;
-       char *home_path = NULL, *rundir = NULL, *relayd_path;
+       char *home_path = NULL, *rundir = NULL, *relayd_path = NULL;
 
        ret = parse_health_env();
        if (ret) {
@@ -222,6 +223,7 @@ int setup_health_path(void)
 
 end:
        free(rundir);
+       free(relayd_path);
        return ret;
 }
 
This page took 0.023292 seconds and 4 git commands to generate.