File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
src/experimental/Security/CWE/CWE-476
test/experimental/query-tests/Security/CWE/CWE-476/semmle/tests Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
...
2
2
try {
3
- if (chackValue ) throw exception ();
3
+ if (checkValue ) throw exception ();
4
4
valData->bufMyData = new myData*[valData->sizeInt ];
5
5
6
6
}
13
13
}
14
14
...
15
15
try {
16
- if (chackValue ) throw exception ();
16
+ if (checkValue ) throw exception ();
17
17
valData->bufMyData = new myData*[valData->sizeInt ];
18
18
19
19
}
Original file line number Diff line number Diff line change 3
3
"qhelp.dtd">
4
4
<qhelp >
5
5
<overview >
6
- <p >When clearing the data in the catch block, you must be sure that the memory was allocated before the exception .</p >
6
+ <p >When releasing memory in a catch block, be sure that the memory was allocated and has not already been released .</p >
7
7
8
8
</overview >
9
9
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ void funcWork3() {
151
151
152
152
void funcWork4 () {
153
153
int a;
154
- myGlobalData *valData;
154
+ myGlobalData *valData = 0 ;
155
155
try {
156
156
valData = new myGlobalData;
157
157
cleanFunction ();
@@ -167,7 +167,7 @@ void funcWork4() {
167
167
168
168
void funcWork4b () {
169
169
int a;
170
- myGlobalData *valData;
170
+ myGlobalData *valData = 0 ;
171
171
try {
172
172
valData = new myGlobalData;
173
173
cleanFunction ();
@@ -181,7 +181,7 @@ void funcWork4b() {
181
181
}
182
182
void funcWork5 () {
183
183
int a;
184
- myGlobalData *valData;
184
+ myGlobalData *valData = 0 ;
185
185
try {
186
186
valData = new myGlobalData;
187
187
cleanFunction ();
@@ -202,7 +202,7 @@ void funcWork5() {
202
202
203
203
void funcWork5b () {
204
204
int a;
205
- myGlobalData *valData;
205
+ myGlobalData *valData = 0 ;
206
206
try {
207
207
valData = new myGlobalData;
208
208
cleanFunction ();
@@ -220,7 +220,7 @@ void funcWork5b() {
220
220
void funcWork6 () {
221
221
int a;
222
222
int flagB = 0 ;
223
- myGlobalData *valData;
223
+ myGlobalData *valData = 0 ;
224
224
try {
225
225
valData = new myGlobalData;
226
226
cleanFunction ();
You can’t perform that action at this time.
0 commit comments