fix long standing memory leak

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
don't compile code used only from tg command

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
delete unused variable in tg.c

Signed-off-by: Masatake YAMATO <yamato@redhat.com>