Test for issue 9334: FP resourceLeak for dlopen/dlclose with library posix (#2151)

Add test to avoid further FP for valid code.
Tests for true positives are already present.
https://trac.cppcheck.net/ticket/9334
This commit is contained in:
Sebastian 2019-09-06 16:37:51 +02:00 committed by GitHub
parent d774359f68
commit 4531b31a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -64,6 +64,11 @@ void validCode(va_list valist_arg1, va_list valist_arg2)
syslog(LOG_WARNING, "warn %d %d", 5, 1);
vsyslog(LOG_EMERG, "emerg %d", valist_arg1);
vsyslog(LOG_INFO, "test %s %d %p", valist_arg2);
void* handle = dlopen("/lib.so", RTLD_NOW);
if (handle) {
dlclose(handle);
}
}
void bufferAccessOutOfBounds(int fd)