Don't try calling lsl when file is missing.
[splint-patched.git] / test / sharing3.c
blob45532a1b38001f5f4c80c4fe2985dc7714a52810
1 extern /*@only@*/ char *string_copyext (char *s) ;
3 void f (void)
5 char *s;
7 if (3 < 4)
9 s = string_copyext ("asdf");
10 free (s);
15 /*@only@*/ char *string_copy (char *s)
17 return s; /* 1. returns temp as only! */
20 /*@only@*/ char *copy_string1 (char *s)
22 return string_copy (s); /* okay */
25 /*@only@*/ char *copy_string2 (char *s)
27 return string_copyext (s); /* okay */
30 void string_free1 (char *s)
32 free (s); /* 2. unqualified as only */
35 void string_free2 (/*@only@*/ char *s)
37 free (s);
40 void string_free3 (/*@only@*/ char *s)
42 char *t = string_copy (s);
43 string_free2 (s);
44 *t = 'a';
45 } /* 3. bad, t not released */
47 void string_free4 (/*@only@*/ char *s)
49 char *t;
50 int i;
52 for (i = 0; i < 3; i++)
54 t = string_copy (s);
55 *t = 'a';
56 free (t);
59 free (s);
60 } /* okay */