The product attempts to return a memory resource to the system, but it calls the wrong release function or calls the appropriate release function incorrectly.
This weakness can take several forms, such as: - The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762). - The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.
Impact: Modify MemoryDoS: Crash, Exit, or RestartExecute Unauthorized Code or Commands
This weakness may result in the corruption of memory, and perhaps instructions, possibly leading to a crash. If the corrupted memory can be effectively controlled, it may be possible to execute arbitrary code.
Strategy: Libraries or Frameworks
cc++
/* do some work with ptr here /
c++c++
/* do some work with ptr here /
c++c
/* matched char, free string and return success / free(str); return SUCCESS;}
cc
/* matched char, free string and return success / free(str); return SUCCESS;}
c//hardcode input length for simplicity* char* input = (char*) malloc(40*sizeof(char)); char tok; char sep = " \t";
c
c//hardcode input length for simplicity* char* input = (char*) malloc(40*sizeof(char)); char *tok, command; char sep = " \t";
c
c