X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fevent-notifier-error-accounting.c;h=cb8380251924476eb0efe4191b361edbac2eb195;hp=34dc2b4fe30e8011ca5998407529d5dc0bd3f388;hb=477b83a4de8580a75e3aa88de423c7081e49d6e0;hpb=5d650dcd9e04bcabd53fdf5f3104b93eb82bc0a9 diff --git a/src/bin/lttng-sessiond/event-notifier-error-accounting.c b/src/bin/lttng-sessiond/event-notifier-error-accounting.c index 34dc2b4fe..cb8380251 100644 --- a/src/bin/lttng-sessiond/event-notifier-error-accounting.c +++ b/src/bin/lttng-sessiond/event-notifier-error-accounting.c @@ -438,7 +438,7 @@ event_notifier_error_accounting_register_app(struct ust_app *app) goto error_send_counter_data; } - cpu_counters = zmalloc(entry->nr_counter_cpu_fds * sizeof(struct lttng_ust_abi_object_data)); + cpu_counters = zmalloc(entry->nr_counter_cpu_fds * sizeof(struct lttng_ust_abi_object_data *)); if (!cpu_counters) { PERROR("Failed to allocate event notifier error counter lttng_ust_abi_object_data array: application uid = %d, application name = '%s', pid = %d, allocation size = %zu", (int) app->uid, app->name, (int) app->pid, @@ -497,6 +497,8 @@ error_duplicate_cpu_counter: free(cpu_counters[i]); } + free(cpu_counters); + error_allocate_cpu_counters: error_send_counter_data: ustctl_release_object(-1, new_counter);