facebook / facebook/infer

Sample code for c in memory-leak-in-c is wrong

Open
#1,430 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
OCaml
Stars
15.7k
Forks
2.1k
Avg merge
19h 36m
Merged PRs (30d)
13

Description

It is just document typo in https://fbinfer.com/docs/all-issue-types#memory-leak-in-c

Bellow code is not legal c-syntax.

```c
-(void) memory_leak_bug {
struct Person *p = malloc(sizeof(struct Person));
}
```

I think it should be:

```c
void memory_leak_bug () {
struct Person *p = malloc(sizeof(struct Person));
}
```

Please include the following information:
- [-] The version of infer from `infer --version`.
- [-] Your operating system and version, for example "Debian 9", "MacOS High Sierra", whether you are using Docker, etc.
- [-] Which command you ran, for example `infer -- make`.
- [-] The full output in a paste, for instance a [gist](https://gist.github.com/).
- [-] If possible, a minimal example to reproduce your problem (for instance, some code where
infer reports incorrectly, together with the way you run infer to reproduce the incorrect
report).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.