File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
cpp/ql/test/query-tests/jsf/4.10 Classes/AV Rule 79 Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1818| NoDestructor.cpp:23:3:23:20 | ... = ... | Resource n is acquired by class MyClass5 but not released anywhere in this class. |
1919| PlacementNew.cpp:36:3:36:36 | ... = ... | Resource p1 is acquired by class MyTestForPlacementNew but not released anywhere in this class. |
2020| SelfRegistering.cpp:25:3:25:24 | ... = ... | Resource side is acquired by class MyOwner but not released anywhere in this class. |
21- | Variants.cpp:25 :3:25 :13 | ... = ... | Resource f is acquired by class MyClass4 but not released anywhere in this class. |
22- | Variants.cpp:65 :3:65 :17 | ... = ... | Resource a is acquired by class MyClass6 but not released anywhere in this class. |
23- | Variants.cpp:66 :3:66 :36 | ... = ... | Resource b is acquired by class MyClass6 but not released anywhere in this class. |
24- | Variants.cpp:67 :3:67 :41 | ... = ... | Resource c is acquired by class MyClass6 but not released anywhere in this class. |
21+ | Variants.cpp:26 :3:26 :13 | ... = ... | Resource f is acquired by class MyClass4 but not released anywhere in this class. |
22+ | Variants.cpp:69 :3:69 :17 | ... = ... | Resource a is acquired by class MyClass6 but not released anywhere in this class. |
23+ | Variants.cpp:70 :3:70 :36 | ... = ... | Resource b is acquired by class MyClass6 but not released anywhere in this class. |
24+ | Variants.cpp:71 :3:71 :41 | ... = ... | Resource c is acquired by class MyClass6 but not released anywhere in this class. |
2525| Wrapped.cpp:46:3:46:22 | ... = ... | Resource ptr2 is acquired by class Wrapped2 but not released anywhere in this class. |
2626| Wrapped.cpp:59:3:59:22 | ... = ... | Resource ptr4 is acquired by class Wrapped2 but not released anywhere in this class. |
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ void *calloc(size_t nmemb, size_t size);
66void *realloc (void *ptr, size_t size);
77void free (void * ptr);
88
9+
910int *ID (int *x)
1011{
1112 return x;
@@ -45,16 +46,19 @@ class MyClass5
4546 a = new int [10 ]; // GOOD
4647 b = (int *)calloc (10 , sizeof (int )); // GOOD
4748 c = (int *)realloc (0 , 10 * sizeof (int )); // GOOD
49+
4850 }
4951
5052 ~MyClass5 ()
5153 {
5254 delete [] a;
5355 free (b);
5456 free (c);
57+
5558 }
5659
5760 int *a, *b, *c;
61+
5862};
5963
6064class MyClass6
@@ -65,13 +69,15 @@ class MyClass6
6569 a = new int [10 ]; // BAD
6670 b = (int *)calloc (10 , sizeof (int )); // BAD
6771 c = (int *)realloc (0 , 10 * sizeof (int )); // BAD
72+
6873 }
6974
7075 ~MyClass6 ()
7176 {
7277 }
7378
7479 int *a, *b, *c;
80+
7581};
7682
7783class MyClass7
You can’t perform that action at this time.
0 commit comments