Fix not NULL pointer on size 0
[lttng-tools.git] / lttng-sessiond / trace-ust.c
index e912c53c7e0face7ca1720752f45dc36b709e777..f52b0b45f009d01c876632833023f91751d78b02 100644 (file)
@@ -92,13 +92,14 @@ struct ltt_ust_session *trace_ust_create_session(char *path, unsigned int uid,
        /* Allocate a new ltt ust session */
        lus = malloc(sizeof(struct ltt_ust_session));
        if (lus == NULL) {
-               perror("create ust session malloc");
+               PERROR("create ust session malloc");
                goto error;
        }
 
        /* Init data structure */
        lus->consumer_fds_sent = 0;
        lus->uid = uid;
+       lus->start_trace = 0;
 
        /* Alloc UST domain hash tables */
        lus->domain_pid = hashtable_new(0);
@@ -220,7 +221,7 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev)
        hashtable_node_init(&lue->node, (void *) lue->attr.name,
                        strlen(lue->attr.name));
        /* Alloc context hash tables */
-       lue->ctx = hashtable_new_str(5);
+       lue->ctx = hashtable_new_str(0);
 
        return lue;
 
@@ -250,7 +251,7 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path)
        lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
        lum->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
        lum->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
-       lum->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
+       lum->attr.output = LTTNG_UST_MMAP;
 
        lum->handle = -1;
        /* Set metadata trace path */
This page took 0.024279 seconds and 4 git commands to generate.