}
/* Append correct directory to subdir */
- strncat(consumer->subdir, dir_name, sizeof(consumer->subdir));
+ strncat(consumer->subdir, dir_name,
+ sizeof(consumer->subdir) - strlen(consumer->subdir) - 1);
DBG3("Copy session consumer subdir %s", consumer->subdir);
ret = LTTCOMM_OK;
pthread_mutex_lock(&kconsumer_data.pid_mutex);
if (kconsumer_data.pid > 0) {
ret = LTTCOMM_KERN_CONSUMER_FAIL;
+ pthread_mutex_unlock(&kconsumer_data.pid_mutex);
goto error;
}
pthread_mutex_unlock(&kconsumer_data.pid_mutex);