fixing segfault when freeing producer metadata