X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fcomponent-class.c;fp=src%2Flib%2Fgraph%2Fcomponent-class.c;h=d17dbd4c1c5192fdb22a837351b3eddfb83280f5;hb=2ce06c9e12da671dd1098ed4174a070af95cb406;hp=9d7e17b57bbb447b1a8be8d3a19246e515fdf4be;hpb=9dd336586407bade390e224fb938b9de8c3ca583;p=babeltrace.git diff --git a/src/lib/graph/component-class.c b/src/lib/graph/component-class.c index 9d7e17b5..d17dbd4c 100644 --- a/src/lib/graph/component-class.c +++ b/src/lib/graph/component-class.c @@ -83,6 +83,11 @@ void destroy_component_class(struct bt_object *obj) class->help = NULL; } + if (class->plugin_name) { + g_string_free(class->plugin_name, TRUE); + class->plugin_name = NULL; + } + if (class->destroy_listeners) { g_array_free(class->destroy_listeners, TRUE); class->destroy_listeners = NULL; @@ -117,6 +122,12 @@ int bt_component_class_init(struct bt_component_class *class, goto error; } + class->plugin_name = g_string_new(NULL); + if (!class->plugin_name) { + BT_LOGE_STR("Failed to allocate a GString."); + goto error; + } + class->destroy_listeners = g_array_new(FALSE, TRUE, sizeof(struct bt_component_class_destroy_listener)); if (!class->destroy_listeners) {