Skip to content

Commit

Permalink
Run the clang 9 formatting script on code fix for lz4 pcap segfault.
Browse files Browse the repository at this point in the history
  • Loading branch information
oxagast committed Jan 27, 2022
1 parent e2f53ed commit 30960b2
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/log-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,10 @@ static int PcapLogOpenHandles(PcapLogData *pl, const Packet *p)
}
comp->file = fopen(pl->filename, "w");
if (comp->file == NULL) {
/* took this out so that it won't print twice, but still would function same
SCLogError(SC_ERR_OPENING_FILE,
"Error opening file for compressed output: %s",
strerror(errno));
*/
/* took this out so that it won't print twice, but still would function
same SCLogError(SC_ERR_OPENING_FILE, "Error opening file for compressed output:
%s", strerror(errno));
*/
return TM_ECODE_FAILED;
}
uint64_t bytes_written = LZ4F_compressBegin(comp->lz4f_context,
Expand Down Expand Up @@ -577,11 +576,10 @@ static int PcapLog (ThreadVars *t, void *thread_data, const Packet *p)
SCLogError(SC_ERR_FSEEK, "fseek failed: %s", strerror(errno));
return TM_ECODE_FAILED;
}
comp->file = fopen(pl->filename, "w");
comp->file = fopen(pl->filename, "w");
if (comp->file == NULL) {
SCLogError(SC_ERR_OPENING_FILE,
"Error opening file for compressed output: %s",
strerror(errno));
SCLogError(SC_ERR_OPENING_FILE, "Error opening file for compressed output: %s",
strerror(errno));
return TM_ECODE_FAILED;
}
if (fwrite(comp->buffer, 1, out_size, comp->file) < out_size) {
Expand Down

0 comments on commit 30960b2

Please sign in to comment.