CHROMIUM: sigrok-cli: fix off by one

Avoid memory corruption by an invalid write when adding the NULL terminator
element at the end of the channels list.

Valgrind seems to agree it's necessary.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=none
TEST=run on Valgrind

Change-Id: Ie43e80600b23cbec4d8cd12e3ae5a5405bbef9a4
diff --git a/session.c b/session.c
index 65cc291..cd23092 100644
--- a/session.c
+++ b/session.c
@@ -246,7 +246,7 @@
 			/* Saving to a session file. */
 			if (rcvd_samples_logic == 0) {
 				/* First packet with logic data, init session file. */
-				channels = g_malloc(sizeof(char *) * g_slist_length(sdi->channels));
+				channels = g_malloc(sizeof(char *) * (g_slist_length(sdi->channels)+1));
 				for (i = 0, l = sdi->channels; l; l = l->next) {
 					ch = l->data;
 					if (ch->type == SR_CHANNEL_LOGIC)