#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
-#include <babeltrace/compat/uuid.h>
-#include <babeltrace/compat/memstream.h>
+#include <babeltrace/compat/uuid-internal.h>
+#include <babeltrace/compat/memstream-internal.h>
#include <babeltrace/ctf-ir/trace.h>
#include <glib.h>
if (*buf) {
free(*buf);
+ *buf = NULL;
}
end:
goto end;
}
+ if (strlen(buf) == 0) {
+ /* An empty metadata packet is OK. */
+ goto end;
+ }
+
/* Convert the real file pointer to a memory file pointer */
fp = bt_fmemopen(buf, strlen(buf), "rb");
close_fp = true;