https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94109

--- Comment #9 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
For the record:

% gfc pr94361.f90 -fanalyzer
pr94361.f90:24:0:

   24 |     end subroutine
      | 
Warning: leak of 'test.t.dat.data' [CWE-401] [-Wanalyzer-malloc-leak]
  'leaker': events 1-11
    |
    |   20 |     subroutine Leaker
    |      | 
    |......
    |   23 |     allocate(Test%T%Dat(100000000))
    |      | 
    |   24 |     end subroutine
    |      | 
    |
    +--> '__final_debug_Testtype2': events 12-30
           |
           |   30 |     end module
           |      |              ~
           |      |              |
           |      |              (18) state of 'test.t.dat.data': 'start' ->
'nonnull' (origin: NULL)
           |      |              (19) state of 'test.t.dat.data': 'start' ->
'nonnull' (origin: NULL)
           |      |              (20) state of 'test.t.dat.data': 'start' ->
'nonnull' (origin: NULL)
           |      |              (21) following 'true' branch...
           |      |              (24) state of 'test.t.dat.data': 'start' ->
'nonnull' (origin: NULL)
           |      |              (25) state of 'test.t.dat.data': 'start' ->
'nonnull' (origin: NULL)
           |      |              (26) state of 'test.t.dat.data': 'start' ->
'nonnull' (origin: NULL)
           |      |              (27) following 'true' branch...
           |
         '__final_debug_Testtype2': events 31-32
           |
f951:

           | (31): state of 'test.t.dat.data': 'start' -> 'nonnull' (origin:
NULL)
           | (32): state of 'test.t.dat.data': 'start' -> 'nonnull' (origin:
NULL)
           |
         '__final_debug_Testtype2': event 33
           |
f951:

           | (33): state of 'test.t.dat.data': 'start' -> 'nonnull' (origin:
NULL)
           |
         '__final_debug_Testtype2': events 34-35
           |
           |   30 |     end module
           |      | 
           |
    <------+
    |
  'leaker': events 36-37
    |
    |   24 |     end subroutine
    |      | 
    |

Is it a false positive or not?

Reply via email to