Clean-up: remove NULL check on sesison_create mandatory arguments
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Sep 2019 23:35:32 +0000 (19:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Sep 2019 23:35:35 +0000 (19:35 -0400)
session_name, base_path, and hostname are assumed to be non-null in
the session_create() function. Checking the pointers for null is
therefore useless.

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

index 827746430712e098d028f8a8105ab881cdf336ed..2f65848a9cedc2ed18bd56a630541b6922db8905 100644 (file)
@@ -181,17 +181,21 @@ struct relay_session *session_create(const char *session_name,
        int ret;
        struct relay_session *session = NULL;
 
-       if (session_name && strstr(session_name, ".")) {
+       assert(session_name);
+       assert(hostname);
+       assert(base_path);
+
+       if (strstr(session_name, ".")) {
                ERR("Illegal character in session name: \"%s\"",
                                session_name);
                goto error;
        }
-       if (base_path && strstr(base_path, "../")) {
+       if (strstr(base_path, "../")) {
                ERR("Invalid session base path walks up the path hierarchy: \"%s\"",
                                base_path);
                goto error;
        }
-       if (hostname && strstr(hostname, ".")) {
+       if (strstr(hostname, ".")) {
                ERR("Invalid character in hostname: \"%s\"",
                                hostname);
                goto error;
This page took 0.027235 seconds and 4 git commands to generate.