Fixing #3515 (Add samples/id/good|bad.cpp)
http://sourceforge.net/apps/trac/cppcheck/ticket/3515
This commit is contained in:
parent
5bb956b0ff
commit
f5c0bb822d
|
@ -0,0 +1,9 @@
|
|||
#include <stdlib.h>
|
||||
int main()
|
||||
{
|
||||
int result;
|
||||
char *a = malloc(10);
|
||||
a[0] = 0;
|
||||
result = a[0];
|
||||
return result;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
#include <stdlib.h>
|
||||
int main()
|
||||
{
|
||||
int result;
|
||||
char *a = malloc(10);
|
||||
a[0] = 0;
|
||||
result = a[0];
|
||||
free(a);
|
||||
return result;
|
||||
}
|
||||
|
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
FILE *a = fopen("good.c", "r");
|
||||
if (!a)
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
FILE *a = fopen("good.c", "r");
|
||||
if (!a)
|
||||
return 0;
|
||||
fclose(a);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue