Site #2: memory leak error
Site #2 : x = ((int *)malloc(1));
Function : "example"
Location : file "example.c", line 8
Details : Allocated cell is freed, but also leaks on some paths
Leak path
y == ((void *)0) example.c, line 15
|
/* File example.c, line 4 */
int example()
4: {
5: int *x;
6: int *y;
7:
8: x = (int *) malloc(1); 9:
10: if(x == NULL)
11: return -1;
12:
13: y = (int *) malloc(1);
14:
15:+ if(y == NULL) 16: return -1;
17:
18: free(x); 19: free(y);
20:
21: return 0;
22: }
| |
Legend of conditions:
c4 : y == ((void *)0) example.c, line 15
|