periscop / openscop

A Specification and a Library for Data Exchange in Polyhedral Compilation Tools
BSD 3-Clause "New" or "Revised" License
26 stars 14 forks source link

Potential leak on scop extraction failure #40

Closed bondhugula closed 5 years ago

bondhugula commented 5 years ago

With commit: 39396a02cbfdad8c25accb425e1beefe856498de

Whenever I see clan_scop_extract failing (i.e., the return scop is NULL or scop->statement is NULL), I see a memory leak; here's the trace from valgrind:

==7501== 136 (128 direct, 8 indirect) bytes in 4 blocks are definitely lost in loss record 44 of 52 ==7501== at 0x483880B: malloc (vg_replace_malloc.c:309) ==7501== by 0x482A1D: clan_symbol_malloc (symbol.c:198) ==7501== by 0x482EDF: clan_symbol_clone_one (symbol.c:514) ==7501== by 0x483081: clan_symbol_new_iterator (symbol.c:596) ==7501== by 0x47E461: yyparse (parser.y:627) ==7501== by 0x4801F4: clan_parse (parser.y:2430) ==7501== by 0x40C16E: main (main.c:553)

bondhugula commented 5 years ago

Sorry wrong repo.