Skip to content

Commit 2909dde

Browse files
authored
Update test.c
1 parent fbf95df commit 2909dde

File tree

1 file changed

+4
-4
lines changed
  • cpp/ql/test/experimental/query-tests/Security/CWE/CWE-415/semmle/tests

1 file changed

+4
-4
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-415/semmle/tests/test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ void workFunction_4(char *s) {
4646
buf = tmpbuf;
4747
free(buf); // GOOD
4848
}
49-
void workFunction_5(char *s) {
49+
void workFunction_5(char *s, int intFlag) {
5050
int intSize = 10;
5151
char *buf;
52-
int intFlag;
52+
5353
buf = (char *) malloc(intSize);
5454
if(intFlag) {
5555
free(buf); // GOOD
5656
}
5757
free(buf); // BAD
5858
}
59-
void workFunction_6(char *s) {
59+
void workFunction_6(char *s, int intFlag;) {
6060
int intSize = 10;
6161
char *buf;
6262
char *tmpbuf;
63-
int intFlag;
63+
6464
tmpbuf = (char *) malloc(intSize);
6565
buf = (char *) malloc(intSize);
6666
if(intFlag) {

0 commit comments

Comments
 (0)