Explicitly check GString pointers for validity before calling glib
routines that would access string content. This silences an assertion
error for a non-fatal runtime condition:
(process:17044): GLib-CRITICAL **: g_string_free: assertion 'string != NULL' failed
* and scalars, so that re-runs start out fresh again.
*/
g_free(inc->sw_version);
- g_string_free(inc->cont_buff, TRUE);
+ if (inc->cont_buff)
+ g_string_free(inc->cont_buff, TRUE);
g_free(inc->sample_data_queue);
for (idx = 0; idx < inc->channel_count; idx++)
g_free(inc->wire_names[idx]);
inc->ch_feed_prep = FALSE;
inc->header_sent = FALSE;
inc->rate_sent = FALSE;
- g_string_truncate(in->buf, 0);
+ if (in->buf)
+ g_string_truncate(in->buf, 0);
return SR_OK;
}