mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Update test.c
This commit is contained in:
@@ -23,7 +23,7 @@ void workFunction_2(char *s) {
|
||||
buf = (char *) malloc(intSize);
|
||||
free(buf); // GOOD
|
||||
buf = NULL;
|
||||
free(buf);
|
||||
free(buf); // GOOD
|
||||
}
|
||||
void workFunction_3(char *s) {
|
||||
int intSize = 10;
|
||||
@@ -31,10 +31,10 @@ void workFunction_3(char *s) {
|
||||
int intFlag;
|
||||
buf = (char *) malloc(intSize);
|
||||
if(buf[1]%5) {
|
||||
free(buf);
|
||||
free(buf); // GOOD
|
||||
buf = NULL;
|
||||
}
|
||||
free(buf);
|
||||
free(buf); // GOOD
|
||||
}
|
||||
void workFunction_4(char *s) {
|
||||
int intSize = 10;
|
||||
@@ -52,7 +52,7 @@ void workFunction_5(char *s) {
|
||||
int intFlag;
|
||||
buf = (char *) malloc(intSize);
|
||||
if(intFlag) {
|
||||
free(buf);
|
||||
free(buf); // GOOD
|
||||
}
|
||||
free(buf); // BAD
|
||||
}
|
||||
@@ -64,10 +64,10 @@ void workFunction_6(char *s) {
|
||||
tmpbuf = (char *) malloc(intSize);
|
||||
buf = (char *) malloc(intSize);
|
||||
if(intFlag) {
|
||||
free(buf);
|
||||
free(buf); // GOOD
|
||||
buf = tmpbuf;
|
||||
}
|
||||
free(buf);
|
||||
free(buf); // GOOD
|
||||
}
|
||||
void workFunction_7(char *s) {
|
||||
int intSize = 10;
|
||||
|
||||
Reference in New Issue
Block a user