diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-06-13 16:45:54 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-06-13 16:45:54 +0200 |
commit | bdf2285959f985bb1d9a92ba22eefadc6d85a393 (patch) | |
tree | a9531ba2693ae4403d5fdcd851cd5eeb2aebeae2 /oui.c | |
parent | ffc485dbcab01699fdbe8d9cf3da6a3f2bbed698 (diff) |
oui: Free allocated record if line is skipped
We would currently leak the record in case we skip a line, fix this by
xfree()ing the memory in these cases.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'oui.c')
-rw-r--r-- | oui.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -56,13 +56,17 @@ void dissector_init_oui(void) v = xmalloc(sizeof(*v)); v->id = strtol(ptr, &end, 0); /* not a valid line, skip */ - if (v->id == 0 && end == ptr) + if (v->id == 0 && end == ptr) { + xfree(v); continue; + } ptr = strstr(buff, ", "); /* likewise */ - if (!ptr) + if (!ptr) { + xfree(v); continue; + } ptr += strlen(", "); ptr = strtrim_right(ptr, '\n'); |