Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all bugs #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add all bugs #3

wants to merge 1 commit into from

Conversation

victoray
Copy link

No description provided.


void dead_store(struct POINT *pnt)
{
int new_x = 9;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEAD_STORE: The value written to &new_x (type int) is never used.

return (-2);
}

return -1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEMORY_LEAK: memory dynamically allocated to return by call to malloc() at line 48, column 23 is not reachable after line 54, column 5.

{
struct POINT *p = malloc(sizeof(struct POINT));

get_x(p);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL_DEREFERENCE: pointer p last assigned on line 66 could be null and is dereferenced by call to get_x() at line 68, column 5.

return 1;
}

return 0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RESOURCE_LEAK: resource of type _IO_FILE acquired to return by call to fopen() at line 37, column 14 is not released after line 43, column 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant