pcapng: Free option_content on error

Change-Id: If36b92def61112f8ebe8cfda0edfb63a15c46af0
Reviewed-on: https://code.wireshark.org/review/25925
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2018-02-20 15:07:08 +01:00
parent fc9ee03ada
commit d209fe6e18
1 changed files with 1 additions and 0 deletions

View File

@ -623,6 +623,7 @@ pcapng_read_section_header_block(FILE_T fh, pcapng_block_header_t *bh,
bytes_read = pcapng_read_option(fh, pn, &oh, option_content, opt_cont_buf_len, to_read, err, err_info, "section_header");
if (bytes_read <= 0) {
pcapng_debug("pcapng_read_section_header_block: failed to read option");
g_free(option_content);
return PCAPNG_BLOCK_ERROR;
}
to_read -= bytes_read;