Skip to content

Commit

Permalink
Remove TODO, fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Dec 4, 2023
1 parent c6924cc commit 1481e16
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions test/cfg/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,13 @@ void resourceLeak_fdopen(int fd)
// cppcheck-suppress resourceLeak
}

void resourceLeak_fdopen2(const char* fn) // #2767
{
int fi = open(fn, O_RDONLY);
FILE* fd = fdopen(fi, "r");
fclose(fd);
}

void resourceLeak_mkstemp(char *template)
{
// cppcheck-suppress unreadVariable
Expand Down Expand Up @@ -1113,13 +1120,6 @@ void resourceLeak_open2(void)
// cppcheck-suppress resourceLeak
}

void resourceLeak_fdopen(const char* fn) // #2767
{
int fi = open(fn, O_RDONLY);
FILE* fd = fdopen(fi, "r");
fclose(fd);
}

void noleak(int x, int y, int z)
{
DIR *p1 = fdopendir(x);
Expand All @@ -1132,12 +1132,6 @@ void noleak(int x, int y, int z)
close(fd1);
int fd2 = open("a", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
close(fd2);
/* TODO: add configuration for open/fdopen
// #2830
int fd = open("path", O_RDONLY);
FILE *f = fdopen(fd, "rt");
fclose(f);
*/
}


Expand Down

0 comments on commit 1481e16

Please sign in to comment.