Project

General

Profile

Actions

Bug #1185

closed

napatech: cppcheck warning

Added by Victor Julien almost 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

Using cppcheck 1.64:

[src/runmode-napatech.c:171]: (error) Memory leak: conf

Actions #1

Updated by Andreas Moe almost 8 years ago

Can't seem to find this cppcheck error message, is this bug report not an issue anymore?

Actions #2

Updated by Victor Julien almost 8 years ago

It's quite easy to spot w/o cppcheck:

    struct NapatechStreamDevConf *conf = SCMalloc(sizeof(struct NapatechStreamDevConf));
    if (unlikely(conf == NULL))
        return NULL;
    if (dev_len < 3 || dev_len > 5)
    {
        SCLogError(SC_ERR_NAPATECH_PARSE_CONFIG, "Could not parse config for device: %s - invalid length", device);
        return NULL; // <- conf not freed.
    }

Actions #3

Updated by Victor Julien over 6 years ago

  • Status changed from New to Assigned
  • Assignee changed from Anonymous to Victor Julien
  • Target version changed from TBD to 4.0.2/4.0.3
Actions #4

Updated by Victor Julien over 6 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF