multipart: fix deallocation of invalid parts

Fixes #16741
This commit is contained in:
George Hopkins 2020-09-02 12:05:25 +02:00
parent 83050495a7
commit 2411eae9ed
1 changed files with 4 additions and 5 deletions

View File

@ -339,14 +339,13 @@ get_multipart_info(packet_info *pinfo, http_message_info_t *message_info)
parameters = unfold_and_compact_mime_header(message_info->media_str, &dummy);
start_boundary = ws_find_media_type_parameter(wmem_packet_scope(), parameters, "boundary");
if(!start_boundary) {
if (!start_boundary) {
return NULL;
}
if(strncmp(type, "multipart/encrypted", sizeof("multipart/encrypted")-1) == 0) {
if (strncmp(type, "multipart/encrypted", sizeof("multipart/encrypted") - 1) == 0) {
start_protocol = ws_find_media_type_parameter(wmem_packet_scope(), parameters, "protocol");
if(!start_protocol) {
g_free(start_boundary);
if (!start_protocol) {
return NULL;
}
}