multiple calls to g_io_channel_read_line and g_free question



Hi,

I have a doubt. I call g_io_channel_read_line several times this way:

g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
//do some things on line
//shall I g_free (line) here ?
g_io_channel_read_line ( ioc, &line, NULL, NULL, NULL );
//ecc

My doubt is: shall I free line before the second call to g_io_channel_read_line or I can call g_free ONCE when I don't need to read anymore ?

Thank you,
--
Colossus
Xarchiver, a GTK2 only archive manager - http://xarchiver.sourceforge.net
Cpsed, a Linux OpenGL 3D scene editor - http://cpsed.sourceforge.net
Mizio, a QT proxy hunter scanner tool - http://mizio.sourceforge.net



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]