Skip to content
Snippets Groups Projects
Commit 640e5721 authored by Lucas Magalhães's avatar Lucas Magalhães
Browse files

Fix possible memory leak in runScript.c

This was reported by cppcheck over require's code:
require-ess/src/runScript.c:128:12: error: Common realloc mistake: 'line_raw' nulled but not freed upon failure [memleakOnRealloc]
      if ((line_raw = realloc(line_raw, line_raw_size *= 2)) == NULL)
           ^

Unfortunately realloc can return null, in that case if we use something
like
line_raw = realloc(line_raw, size);
The memory pointed by line_raw is lost.
parent b2085515
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment