From: Jérémie Galarneau Date: Sat, 27 May 2017 19:06:32 +0000 (-0400) Subject: Fix: return of garbage value in copy_find_clock_array_field on error X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=53296853bee7ad16d7a333d130313aa445660c0b;p=deliverable%2Fbabeltrace.git Fix: return of garbage value in copy_find_clock_array_field on error Signed-off-by: Jérémie Galarneau --- diff --git a/plugins/libctfcopytrace/clock-fields.c b/plugins/libctfcopytrace/clock-fields.c index 300540216..8ae0e73bc 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;