- user_data = malloc(sizeof(*user_data));
- user_data->free_func = cpy_destroy_user_data;
- user_data->data = c;
- register_function(buf, handler, user_data);
+
+ memset (&user_data, 0, sizeof (user_data));
+ user_data.free_func = cpy_destroy_user_data;
+ user_data.data = c;
+
+ register_function(buf, handler, &user_data);