Fix: Memory leaks of allocated URIs
authorDavid Goulet <dgoulet@efficios.com>
Fri, 26 Oct 2012 16:32:42 +0000 (12:32 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 26 Oct 2012 16:32:42 +0000 (12:32 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/main.c

index b5a98432fb53468c6f1b1cc1dbb5e61918bddf95..41cdf112687c86fc60af8d832b07684dfc4c49bd 100644 (file)
@@ -2553,12 +2553,14 @@ skip_domain:
                        DBG("No URIs received from client... continuing");
                        *sock_error = 1;
                        ret = LTTNG_ERR_SESSION_FAIL;
+                       free(uris);
                        goto error;
                }
 
                ret = cmd_set_consumer_uri(cmd_ctx->lsm->domain.type, cmd_ctx->session,
                                nb_uri, uris);
                if (ret != LTTNG_OK) {
+                       free(uris);
                        goto error;
                }
 
@@ -2579,6 +2581,8 @@ skip_domain:
                        }
                }
 
+               free(uris);
+
                break;
        }
        case LTTNG_START_TRACE:
@@ -2613,12 +2617,14 @@ skip_domain:
                                DBG("No URIs received from client... continuing");
                                *sock_error = 1;
                                ret = LTTNG_ERR_SESSION_FAIL;
+                               free(uris);
                                goto error;
                        }
 
                        if (nb_uri == 1 && uris[0].dtype != LTTNG_DST_PATH) {
                                DBG("Creating session with ONE network URI is a bad call");
                                ret = LTTNG_ERR_SESSION_FAIL;
+                               free(uris);
                                goto error;
                        }
                }
@@ -2626,6 +2632,8 @@ skip_domain:
                ret = cmd_create_session_uri(cmd_ctx->lsm->session.name, uris, nb_uri,
                        &cmd_ctx->creds);
 
+               free(uris);
+
                break;
        }
        case LTTNG_DESTROY_SESSION:
This page took 0.036152 seconds and 4 git commands to generate.