• Guilherme Maciel Ferreira's avatar
    Fix double free at Log_terminate() · 6b398fc1
    Guilherme Maciel Ferreira authored
    Set to NULL the two static char pointers, trace_destination_name and
    trace_destination_backup_name. Otherwise, there is a double free if
    someone tries to release the same memory more than once (calling the
    Log_terminate() function twice).
    
    ==5781== Invalid free() / delete / delete[] / realloc()
    ==5781==    at 0x4C29CF0: free (vg_replace_malloc.c:530)
    ==5781==    by 0x40DF4C: Log_terminate (Log.c:225)
    ==5781==  Address 0x5495c20 is 0 bytes inside a block of size 13 free'd
    ==5781==    at 0x4C29CF0: free (vg_replace_malloc.c:530)
    ==5781==    by 0x40DF4C: Log_terminate (Log.c:225)
    ==5781==  Block was alloc'd at
    ==5781==    at 0x4C28BF6: malloc (vg_replace_malloc.c:299)
    ==5781==    by 0x40D881: Log_initialize (Log.c:139)
    ==5781==
    ==5781== Invalid free() / delete / delete[] / realloc()
    ==5781==    at 0x4C29CF0: free (vg_replace_malloc.c:530)
    ==5781==    by 0x40DF79: Log_terminate (Log.c:227)
    ==5781==  Address 0x5495c70 is 0 bytes inside a block of size 15 free'd
    ==5781==    at 0x4C29CF0: free (vg_replace_malloc.c:530)
    ==5781==    by 0x40DF79: Log_terminate (Log.c:227)
    ==5781==  Block was alloc'd at
    ==5781==    at 0x4C28BF6: malloc (vg_replace_malloc.c:299)
    ==5781==    by 0x40D8B6: Log_initialize (Log.c:141)
    Signed-off-by: 's avatarGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
    6b398fc1
Log.c 14.5 KB