]> sigrok.org Git - libsigrokdecode.git/commitdiff
instance.c: Fix a scan-build warning.
authorUwe Hermann <redacted>
Tue, 15 May 2018 22:24:56 +0000 (00:24 +0200)
committerUwe Hermann <redacted>
Wed, 16 May 2018 10:17:42 +0000 (12:17 +0200)
  instance.c:278:25: warning: The left operand of '!=' is a garbage value
                  if (new_channelmap[i] != -1)
                      ~~~~~~~~~~~~~~~~~ ^

instance.c

index a94118f2430de4991f70708522999fc49e02b53c..17809be9a2b3777829f91a9935c1739d7d850c96 100644 (file)
@@ -223,7 +223,7 @@ SRD_API int srd_inst_channel_set_all(struct srd_decoder_inst *di,
                return SRD_ERR_ARG;
        }
 
-       new_channelmap = g_malloc(sizeof(int) * di->dec_num_channels);
+       new_channelmap = g_malloc0(sizeof(int) * di->dec_num_channels);
 
        /*
         * For now, map all indexes to channel -1 (can be overridden later).