<div>Salut,</div><div><br></div><div>Primesc memory leaks de la valgrind in cazul in care utilizez "fork()" fara a face si execvp (altfel spus cand folosesc &, | sau comanda invalida).</div><div>Mai jos e mesajul din valgrind. Nu stiu ce sa ii mai fac. Ii dau "free_parse_memory()" inainte de fiecare "exit(code)" al fiecarui copil si pentru cazul in care fork() ar esua. Am elliminat restul memory leak-urilor care nu tine de parser. La acesta mai mult de un "free_parse_memory()" inainte de fiecare exit nu pot face.</div>
<div><br></div><div><div><div>==17445== HEAP SUMMARY:</div><div>==17445== in use at exit: 8 bytes in 1 blocks</div><div>==17445== total heap usage: 13 allocs, 12 frees, 362 bytes allocated</div><div>==17445== </div>
<div>==17445== 8 bytes in 1 blocks are still reachable in loss record 1 of 1</div><div>==17445== at 0x4C28F9F: malloc (vg_replace_malloc.c:236)</div><div>==17445== by 0x4052C8: yyalloc(unsigned long) (parser.yy.c:2006)</div>
<div>==17445== by 0x404DB9: yyensure_buffer_stack() (parser.yy.c:1707)</div><div>==17445== by 0x4047E8: yy_switch_to_buffer(yy_buffer_state*) (parser.yy.c:1504)</div><div>==17445== by 0x404FB3: yy_scan_buffer(char*, unsigned long) (parser.yy.c:1767)</div>
<div>==17445== by 0x4050A0: yy_scan_bytes(char const*, int) (parser.yy.c:1811)</div><div>==17445== by 0x404FFC: yy_scan_string(char const*) (parser.yy.c:1783)</div><div>==17445== by 0x405326: globalParseAnotherString (parser.l:243)</div>
<div>==17445== by 0x407F4B: parse_line (parser.y:540)</div><div>==17445== by 0x4016E5: main (Tema1.cpp:47)</div><div>==17445== </div><div>==17445== LEAK SUMMARY:</div><div>==17445== definitely lost: 0 bytes in 0 blocks</div>
<div>==17445== indirectly lost: 0 bytes in 0 blocks</div><div>==17445== possibly lost: 0 bytes in 0 blocks</div><div>==17445== still reachable: 8 bytes in 1 blocks</div><div>==17445== suppressed: 0 bytes in 0 blocks</div>
</div><div><br></div>-- <br>Mihail Costea<div>E-mail : <a href="mailto:mihail.costea90@gmail.com" target="_blank">mihail.costea90@gmail.com</a></div><div>Telephone : +40725245085</div><br>
</div>