Fix: leak on error in lttng-crash
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 27 Mar 2015 19:52:00 +0000 (15:52 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 27 Mar 2015 20:18:52 +0000 (16:18 -0400)
Found by Coverity:
** CID 1291945:  Resource leaks  (RESOURCE_LEAK)
/src/bin/lttng-crash/lttng-crash.c: 769 in copy_crash_data()

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-crash/lttng-crash.c

index 793877d9d846fd06c906488926884971632fe60d..4f1efe96dada1b00671309b1fe39358ce4bed411 100644 (file)
@@ -766,7 +766,8 @@ int copy_crash_data(const struct lttng_crash_layout *layout, int fd_dest,
        readlen = lttng_read(fd_src, buf, src_file_len);
        if (readlen < 0) {
                PERROR("Error reading input file");
-               return -1;
+               ret = -1;
+               goto end;
        }
 
        prod_offset = crash_get_field(layout, buf, prod_offset);
This page took 0.024846 seconds and 4 git commands to generate.