From 53296853bee7ad16d7a333d130313aa445660c0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 27 May 2017 15:06:32 -0400 Subject: [PATCH] Fix: return of garbage value in copy_find_clock_array_field on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- plugins/libctfcopytrace/clock-fields.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/libctfcopytrace/clock-fields.c b/plugins/libctfcopytrace/clock-fields.c index 30054021..8ae0e73b 100644 --- a/plugins/libctfcopytrace/clock-fields.c +++ b/plugins/libctfcopytrace/clock-fields.c @@ -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; -- 2.34.1