User Activity

  • Posted a comment on discussion Development on cppcheck

    The following snipped causes a doubleFree false positive, since fdopen(3) is treated to always deallocate a file descriptor resource, and not only on success: #include <fcntl.h> #include <stdio.h> #include <unistd.h> void foo(void) { int fd; FILE *stream; fd = open("/foo", O_RDONLY); if (fd == -1) return; stream = fdopen(fd, "r"); if (!stream) { close(fd); return; } fclose(stream); } Report: cppcheck_fp.c:15:3: error: Resource handle 'fd' freed twice. [doubleFree] close(fd); ^ cppcheck_fp.c:13:11:...

View All

Personal Data

Username:
cgzones
Joined:
2024-05-26 12:51:22.262000

Projects

  • No projects to display.

Personal Tools