Signed-off-by: David Goulet <dgoulet@efficios.com>
- if (new_session != NULL) {
- free(new_session);
- }
error_malloc:
return ret;
error_malloc:
return ret;
ret = CMD_SUCCESS;
error:
ret = CMD_SUCCESS;
error:
- if (alloc_url) {
- free(alloc_url);
- }
-
- if (traces_path) {
- free(traces_path);
- }
+ free(alloc_url);
+ free(traces_path);
free(alloc_path);
if (ret < 0) {
free(alloc_path);
if (ret < 0) {
- if (events) {
- free(events);
- }
ret = CMD_SUCCESS;
error:
ret = CMD_SUCCESS;
error:
- if (domains) {
- free(domains);
- }
if (handle) {
lttng_destroy_handle(handle);
}
if (handle) {
lttng_destroy_handle(handle);
}
- if (sessions) {
- free(sessions);
- }
free_error:
if (opt_session_name == NULL) {
free(session_name);
free_error:
if (opt_session_name == NULL) {
free(session_name);
- if (file_path) {
- free(file_path);
- }
*/
static inline void __lttng_poll_free(void *events)
{
*/
static inline void __lttng_poll_free(void *events)
{
- if (events) {
- free(events);
- }
*/
pthread_mutex_lock(&consumer_data.lock);
if (consumer_data.need_update) {
*/
pthread_mutex_lock(&consumer_data.lock);
if (consumer_data.need_update) {
- if (pollfd != NULL) {
- free(pollfd);
- pollfd = NULL;
- }
- if (local_stream != NULL) {
- free(local_stream);
- local_stream = NULL;
- }
+ free(pollfd);
+ pollfd = NULL;
+
+ free(local_stream);
+ local_stream = NULL;
/* allocate for all fds + 1 for the consumer_data_pipe */
pollfd = zmalloc((consumer_data.stream_count + 1) * sizeof(struct pollfd));
/* allocate for all fds + 1 for the consumer_data_pipe */
pollfd = zmalloc((consumer_data.stream_count + 1) * sizeof(struct pollfd));
}
end:
DBG("polling thread exiting");
}
end:
DBG("polling thread exiting");
- if (pollfd != NULL) {
- free(pollfd);
- pollfd = NULL;
- }
- if (local_stream != NULL) {
- free(local_stream);
- local_stream = NULL;
- }
+ free(pollfd);
+ free(local_stream);
/*
* Close the write side of the pipe so epoll_wait() in
/*
* Close the write side of the pipe so epoll_wait() in
__attribute__((visibility("hidden")))
void lttcomm_destroy_sock(struct lttcomm_sock *sock)
{
__attribute__((visibility("hidden")))
void lttcomm_destroy_sock(struct lttcomm_sock *sock)
{
- if (sock != NULL) {
- free(sock);
- }
__attribute__((visibility("hidden")))
void uri_free(struct lttng_uri *uri)
{
__attribute__((visibility("hidden")))
void uri_free(struct lttng_uri *uri)
{
- /* Safety check */
- if (uri != NULL) {
- free(uri);
- }
*/
void lttng_destroy_handle(struct lttng_handle *handle)
{
*/
void lttng_destroy_handle(struct lttng_handle *handle)
{
- if (handle) {
- free(handle);
- }