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

C Simple memory leak cannot be detected #1774

Closed
Achillesed opened this issue Jul 6, 2023 · 1 comment
Closed

C Simple memory leak cannot be detected #1774

Achillesed opened this issue Jul 6, 2023 · 1 comment

Comments

@Achillesed
Copy link

version of infer - [ infer 1.1.0]
operating system and version - [ Ubuntu22.04]
command - [infer run -- gcc -c]
full output in a paste

1/1 [################################################################################] 100% 21.233ms

t.c:4: error: Dead Store
  The value written to &ptr (type int*) is never used.
  2. #include<stdlib.h>
  3. int main(){
  4.     int* ptr=malloc(sizeof(int));   //src
         ^
  5.     return 0;
  6. }


Found 1 issue
  Issue Type(ISSUED_TYPE_ID): #
      Dead Store(DEAD_STORE): 1

a minimal example

#include<stdio.h>
#include<stdlib.h>
int main(){
    int* ptr=malloc(sizeof(int));
    return 0;
}
@Achillesed Achillesed changed the title C 简单的内存泄漏检测不出 C Simple memory leak cannot be detected Jul 7, 2023
@Achillesed
Copy link
Author

--pluse

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

No branches or pull requests

1 participant