Project

General

Profile

Bug #9393

Problem with memleak visualization on absent return from void function

Added by Anton Vasilyev 7 months ago. Updated 7 months ago.

Status:
New
Priority:
Urgent
Assignee:
Category:
Results processing
Target version:
Start date:
11/20/2018
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

For void functions with absent return:

/*
 * Use the Fisher-Yates shuffle algorithm on an array of lines.
 */
static void shuffle_lines(char **lines, unsigned numlines)
{
    unsigned i;
    unsigned r;
    char *tmp;

    srand(monotonic_us());

    for (i = numlines-1; i > 0; i--) {
        r = rand();
        /* RAND_MAX can be as small as 32767 */
        if (i > RAND_MAX)
            r ^= rand() << 15;
        r %= i + 1;
        tmp = lines[i];
        lines[i] = lines[r];
        lines[r] = tmp;
    }
}

SMG generates warning edge without source code like:

 <edge source="A85098" target="A85104">
   <data key="returnFrom">shuffle_lines</data>
   <data key="warning">Memory leak is detected</data>
 </edge>

Require to specify Klever and SMG interaction for this corner case.

History

#1

Updated by Ilja Zakharov 7 months ago

  • Target version set to 3.0
  • Priority changed from Normal to Urgent
  • Assignee set to Ilja Zakharov
  • Category set to Results processing

Also available in: Atom PDF