output: Allocate additional memory for NULL terminator.

Best regards,
Marc

>From a7228150fdea91a65b5d70359bf51b87d2572edf Mon Sep 17 00:00:00 2001
From: Marc Schink <sigrok-dev@marcschink.de>
Date: Wed, 20 Aug 2014 05:34:57 -0400
Subject: [PATCH] output: Allocate additional memory for NULL terminator.
This commit is contained in:
Marc Schink 2014-08-20 13:54:53 +02:00 committed by Bert Vermeulen
parent f817f05aac
commit 879dd50fb6
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ SR_API const struct sr_option **sr_output_options_get(const struct sr_output_mod
for (size = 1; mod_opts[size].id; size++) for (size = 1; mod_opts[size].id; size++)
; ;
opts = g_malloc(size * sizeof(struct sr_option *)); opts = g_malloc((size + 1) * sizeof(struct sr_option *));
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
opts[i] = &mod_opts[i]; opts[i] = &mod_opts[i];