Skip to content
Snippets Groups Projects
Forked from ESS EPICS Environment / wrappers / e3-require
Source project has a limited visibility.
  • Lucas Magalhães's avatar
    640e5721
    Fix possible memory leak in runScript.c · 640e5721
    Lucas Magalhães authored
    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.
    640e5721
    History
    Fix possible memory leak in runScript.c
    Lucas Magalhães authored
    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.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.