merces/pev — pull request #32 by felipensp (2012-11-03 19:02:13+00:00)
Title: Pedis memleak on usage when providing a PE file

This change fixes a memleak found when providing a binary for **pedis**, but only usage is shown.

``` $ pedis --att ~/idafree50.exe ```

It was resulting:

```
==21984== HEAP SUMMARY:
==21984== in use at exit: 680 bytes in 3 blocks
==21984== total heap usage: 3 allocs, 0 frees, 680 bytes allocated
==21984==
==21984== 96 bytes in 1 blocks are indirectly lost in loss record 1 of 3
==21984== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==21984== by 0x4E2FF52: xmalloc (in /usr/lib/libpe.so.1.0)
==21984== by 0x4E3097E: pe_get_optional (in /usr/lib/libpe.so.1.0)
==21984== by 0x401A35: main (in /home/felipe/dev/pev/src/pedis)
==21984==
==21984== 112 (16 direct, 96 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 3
==21984== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==21984== by 0x4E2FF52: xmalloc (in /usr/lib/libpe.so.1.0)
==21984== by 0x4E3094E: pe_get_optional (in /usr/lib/libpe.so.1.0)
==21984== by 0x401A35: main (in /home/felipe/dev/pev/src/pedis)
==21984==
==21984== 568 bytes in 1 blocks are still reachable in loss record 3 of 3
==21984== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==21984== by 0x509940A: __fopen_internal (iofopen.c:76)
==21984== by 0x401999: main (in /home/felipe/dev/pev/src/pedis)
```