g_free_byte_array accepts as the second argument a gboolean which determines if
the actual byte data should also be freed:
https://developer.gnome.org/glib/2.28/glib-Byte-Arrays.html#g-byte-array-free
If we pass a FALSE here the data should be freed with g_free(), instead just
pass TRUE and the data will be automatically freed.
if (sr_session_save(opt_output_file, sdi, savebuf->data,
unitsize, savebuf->len / unitsize) != SR_OK)
g_critical("Failed to save session.");
- g_byte_array_free(savebuf, FALSE);
+ g_byte_array_free(savebuf, TRUE);
}
}