home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lclint.zip
/
lclint-2_3h-os2-bin.zip
/
test
/
merge.c
< prev
next >
Wrap
Text File
|
1997-09-03
|
659b
|
56 lines
/*@null@*/ int *x;
void f1 (void)
{
int *y = x;
if (3 > 4)
{
;
}
else
{
x = NULL;
if (y != NULL) free (y);
}
/* y is unuseable...but no error yet */
}
void f2 (void)
{
int *y = x;
if (3 > 4)
{
;
}
else
{
x = NULL;
if (y != NULL) free (y);
}
*y = 23; /* 1. Variable y used in inconsistent state */
} /* 2. Dereference of possibly null pointer y: *y */
void f3 (void)
{
int *y = x;
if (3 > 4)
{
;
}
else
{
x = NULL;
if (y != NULL) free (y);
}
y = x;
*y = 23; /* 3. Dereference of possibly null pointer y: *y */
}