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 11...
22try {
3- if (chackValue ) throw exception ();
3+ if (checkValue ) throw exception ();
44 valData->bufMyData = new myData*[valData->sizeInt ];
55
66 }
1313 }
1414...
1515try {
16- if (chackValue ) throw exception ();
16+ if (checkValue ) throw exception ();
1717 valData->bufMyData = new myData*[valData->sizeInt ];
1818
1919 }
Original file line number Diff line number Diff line change 33 "qhelp.dtd">
44<qhelp >
55<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 >
77
88</overview >
99
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ void funcWork3() {
151151
152152void funcWork4 () {
153153 int a;
154- myGlobalData *valData;
154+ myGlobalData *valData = 0 ;
155155 try {
156156 valData = new myGlobalData;
157157 cleanFunction ();
@@ -167,7 +167,7 @@ void funcWork4() {
167167
168168void funcWork4b () {
169169 int a;
170- myGlobalData *valData;
170+ myGlobalData *valData = 0 ;
171171 try {
172172 valData = new myGlobalData;
173173 cleanFunction ();
@@ -181,7 +181,7 @@ void funcWork4b() {
181181}
182182void funcWork5 () {
183183 int a;
184- myGlobalData *valData;
184+ myGlobalData *valData = 0 ;
185185 try {
186186 valData = new myGlobalData;
187187 cleanFunction ();
@@ -202,7 +202,7 @@ void funcWork5() {
202202
203203void funcWork5b () {
204204 int a;
205- myGlobalData *valData;
205+ myGlobalData *valData = 0 ;
206206 try {
207207 valData = new myGlobalData;
208208 cleanFunction ();
@@ -220,7 +220,7 @@ void funcWork5b() {
220220void funcWork6 () {
221221 int a;
222222 int flagB = 0 ;
223- myGlobalData *valData;
223+ myGlobalData *valData = 0 ;
224224 try {
225225 valData = new myGlobalData;
226226 cleanFunction ();
You can’t perform that action at this time.
0 commit comments