Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: double-'free' of '<unknown>' [CWE-415] [-Werror=analyzer-double-free] #80

Open
yesudeep opened this issue Nov 5, 2021 · 1 comment

Comments

@yesudeep
Copy link
Contributor

yesudeep commented Nov 5, 2021

Error:

third_party/utest/utest.h: In function 'utest_main':
third_party/utest/utest.h:1122:5: error: double-'free' of '<unknown>' [CWE-415] [-Werror=analyzer-double-free]
 1122 |     free(UTEST_PTR_CAST(void *, utest_state.tests[index].name));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as error

Build configuration:

❯ ./configure
...
Configuration parameters:
  AR_FLAGS                       cru
  CC                             gcc
  CC vendor                      gnu
  CC version                     10.3.0
  CFLAGS
                                 -g
                                 -O2
                                 -std=c11
                                 -fanalyzer
                                 -fdiagnostics-color=always
                                 -Wall
                                 -Wextra
                                 -Werror
                                 -Wfatal-errors
                                 -Wpedantic
                                 -pedantic-errors
                                 -Werror=missing-declarations
                                 -Werror=unused
                                 -Werror=unused-result
                                 -Werror=unused-local-typedefs
                                 -Werror=write-strings
                                 -Werror=sign-conversion
                                 -Werror=narrowing
                                 -Werror=uninitialized
                                 -Wformat=2
                                 -Wformat-security
                                 -Wformat-y2k
                                 -fstack-protector-all
  CPP                            gcc -E
  CPPFLAGS
                                 -U_FORTIFY_SOURCE
                                 -D_FORTIFY_SOURCE=2
  CXX                            g++
  CXX vendor
  CXX version
  CXXFLAGS
                                 -g
                                 -O2
  LDFLAGS
  HOST
  HOSTNAME
  OSTYPE
  uname -mrs                     FreeBSD 13.0-RELEASE amd64
  host                           amd64-unknown-freebsd13.0
  enable-hardening               yes
  enable-asan                    no
  enable-tsan                    no
  enable-ubsan                   no
@sheredom
Copy link
Owner

I'm not doubting that this is right - but I cannot for the life of me work out how this is possible with the code. Is there anyway that warning can be wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants