Project

General

Profile

Actions

Bug #7813

closed

cppcheck: warnings in counters.c

Added by Victor Julien 27 days ago. Updated 3 days ago.

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

Description

src/counters.c:1108:13: warning: If memory allocation fails, then there is a possible null pointer dereference: id [nullPointerOutOfMemory]
            id->id = counters_global_id++;
            ^
src/counters.c:1106:26: note: Assuming allocation function fails
            id = SCCalloc(1, sizeof(*id));
                         ^
src/counters.c:1106:26: note: Assignment 'id=calloc(1,sizeof(*id))', assigned value is 0
            id = SCCalloc(1, sizeof(*id));
                         ^
src/counters.c:1108:13: note: Null pointer dereference
            id->id = counters_global_id++;
            ^
src/counters.c:1109:13: warning: If memory allocation fails, then there is a possible null pointer dereference: id [nullPointerOutOfMemory]
            id->string = pc->name;
            ^
src/counters.c:1106:26: note: Assuming allocation function fails
            id = SCCalloc(1, sizeof(*id));
                         ^
src/counters.c:1106:26: note: Assignment 'id=calloc(1,sizeof(*id))', assigned value is 0
            id = SCCalloc(1, sizeof(*id));
                         ^
src/counters.c:1109:13: note: Null pointer dereference
            id->string = pc->name;
            ^
src/counters.c:1116:19: warning: If memory allocation fails, then there is a possible null pointer dereference: id [nullPointerOutOfMemory]
        pc->gid = id->id;
                  ^
src/counters.c:1106:26: note: Assuming allocation function fails
            id = SCCalloc(1, sizeof(*id));
                         ^
src/counters.c:1106:26: note: Assignment 'id=calloc(1,sizeof(*id))', assigned value is 0
            id = SCCalloc(1, sizeof(*id));
                         ^
src/counters.c:1116:19: note: Null pointer dereference
        pc->gid = id->id;
                  ^
Actions #1

Updated by Philippe Antoine 23 days ago

  • Affected Versions 8.0.0 added
Actions #2

Updated by Philippe Antoine 16 days ago

  • Status changed from New to In Review
  • Assignee changed from OISF Dev to Philippe Antoine
Actions #3

Updated by Jason Ish 3 days ago

  • Status changed from In Review to Closed
Actions

Also available in: Atom PDF