Implement ctf.lttng-live component
[babeltrace.git] / plugins / ctf / common / metadata / decoder.c
index 6dbd81608bcbbb714c92887df50bd17ed1eb5d36..41badbb6412719ab063ce90b282b309f2436f89a 100644 (file)
@@ -17,8 +17,8 @@
 #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>
 
@@ -248,6 +248,7 @@ error:
 
        if (*buf) {
                free(*buf);
+               *buf = NULL;
        }
 
 end:
@@ -320,6 +321,11 @@ enum ctf_metadata_decoder_status ctf_metadata_decoder_decode(
                        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;
This page took 0.024945 seconds and 4 git commands to generate.