Project

General

Profile

Actions

Bug #1332

closed

cppcheck: ioctl

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

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

Description

[src/util-ioctl.c:226]: (error) Resource leak: fd
[src/util-ioctl.c:238]: (error) Mismatching allocation and deallocation: fd
[src/util-ioctl.c:241]: (error) Mismatching allocation and deallocation: fd

Actions #1

Updated by Eric Leblond almost 10 years ago

It may be a false positive here. All returns are preceded by a close call with fd param but the first which is the case where we handle the failure. By the way, I've got no error with cppcheck 1.67 by running:

cppcheck --enable=all --force --inconclusive --std=posix  src/util-ioctl.c --quiet

Actions #2

Updated by Victor Julien almost 10 years ago

I wonder if the "Mismatching allocation and deallocation: fd" are about using 'close' instead of 'shutdown'?

Actions #3

Updated by Victor Julien almost 10 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

My cppcheck version was 1.64. I can confirm the issue is gone in 1.67.

Actions

Also available in: Atom PDF