The hashtable storing the trace handle is created with a destroy
function that frees the elements when they are removed. Manually calling
the destroy function after removing a handle for the table causes
double-free problems.
Fixes #197
Reported-by: Mathieu Denis <mathieu.denis@polymtl.ca>
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
/* Remove from containers */
trace_collection_remove(ctx->tc, handle->td);
- g_hash_table_remove(ctx->trace_handles,
- (gpointer) (unsigned long) handle_id);
-
/* Close the trace */
handle->format->close_trace(handle->td);
- /* Destory the handle */
- bt_trace_handle_destroy(handle);
+ /* Remove and free the handle */
+ g_hash_table_remove(ctx->trace_handles,
+ (gpointer) (unsigned long) handle_id);
+
}
static