Fix: return of garbage value in copy_find_clock_array_field on error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 19:06:32 +0000 (15:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:45 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/libctfcopytrace/clock-fields.c

index 300540216019ccdd7a046d818bfff30f41bc1b6f..8ae0e73bc4adaa2503c35c5090aa87a5206eac12 100644 (file)
@@ -660,6 +660,7 @@ int copy_find_clock_array_field(FILE *err,
        for (i = 0; i < count; i++) {
                entry_field = bt_ctf_field_array_get_field(field, i);
                if (!entry_field) {
+                       ret = -1;
                        fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__,
                                        __LINE__);
                        goto error;
@@ -667,6 +668,7 @@ int copy_find_clock_array_field(FILE *err,
 
                entry_copy = bt_ctf_field_array_get_field(copy_field, i);
                if (!entry_copy) {
+                       ret = -1;
                        fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__,
                                        __LINE__);
                        goto error;
This page took 0.02636 seconds and 4 git commands to generate.