ciscodump: fix line parsing and fix memleak.

Change-Id: I4aee51d7def06317a543fdc8fa05120af0e68453
Reviewed-on: https://code.wireshark.org/review/17531
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Dario Lombardo 2016-09-06 14:42:29 +02:00 committed by Peter Wu
parent 595610f9cc
commit 26551ba411
1 changed files with 2 additions and 1 deletions

View File

@ -208,7 +208,7 @@ static int parse_line(char* packet _U_, unsigned* offset, char* line, int status
/* ABCDEF01: 01020304 05060708 090A0B0C 0D0E0F10 ................ */
/* Note that any of the 4 groups are optional and that a group can be 1 to 4 bytes long */
parts = g_regex_split_simple(
"^[\\dA-Z]{8,8}:\\s+([\\dA-Z]{2,8})\\s+([\\dA-Z]{2,8}){0,1}\\s+([\\dA-Z]{2,8}){0,1}\\s+([\\dA-Z]{2,8}){0,1}.*",
"^[\\dA-F]{8,8}:\\s+([\\dA-F]{2,8})\\s+([\\dA-F]{2,8}){0,1}\\s+([\\dA-F]{2,8}){0,1}\\s+([\\dA-F]{2,8}){0,1}.*",
line, G_REGEX_CASELESS, G_REGEX_MATCH_ANCHORED);
part = parts;
@ -222,6 +222,7 @@ static int parse_line(char* packet _U_, unsigned* offset, char* line, int status
}
part++;
}
g_strfreev(parts);
return CISCODUMP_PARSER_IN_PACKET;
}