Skip to contentSkip to conversation

Fix: leak on error in lttng-crash

PATCH Jérémie Galarneau 1 participant 1 message Mar 27, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jérémie Galarneau

author Applied
#1 lore raw

Merged, thanks!

Jérémie

Quoted 26 lines · Mathieu Desnoyers

Found by Coverity:
** CID 1291945: Resource leaks (RESOURCE_LEAK) /src/bin/lttng-crash/lttng-crash.c: 769 in copy_crash_data()

---
 src/bin/lttng-crash/lttng-crash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
src/bin/lttng-crash/lttng-crash.c +2 -2
index 793877d..4f1efe9 100644
@@ -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);
--

2.1.4

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev