Message ID | 20230602035815.43904076@rorschach.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | d7ce897734a9046b28866a13d12e78e9d492c72a |
Headers | show |
Series | libtracecmd: Free buf_from in error path of tracecmd_compress_copy_from() | expand |
diff --git a/lib/trace-cmd/trace-compress.c b/lib/trace-cmd/trace-compress.c index ca6e03b88e69..e550dbd4b0d5 100644 --- a/lib/trace-cmd/trace-compress.c +++ b/lib/trace-cmd/trace-compress.c @@ -696,8 +696,10 @@ int tracecmd_compress_copy_from(struct tracecmd_compression *handle, int fd, int return -1; buf_to = malloc(csize); - if (!buf_to) + if (!buf_to) { + free(buf_from); return -1; + } /* save the initial offset and write 0 as initial chunk count */ offset = lseek(handle->fd, 0, SEEK_CUR);