X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=bebe96cb8a9b8afe0932d22de1f9070b69717147;hp=a3a48b736ea2ffa5760c01f2e7953e071ae86bee;hb=2d661bcb259dedee1857e90749418ce72f571ba6;hpb=fa168be6b75b28026dddb573e103917e0ab89806 diff --git a/decoder.c b/decoder.c index a3a48b7..bebe96c 100644 --- a/decoder.c +++ b/decoder.c @@ -219,7 +219,7 @@ static int get_channels(const struct srd_decoder *d, const char *attr, "a list of dict elements.", d->name, attr); goto err_out; } - pdch = g_malloc0(sizeof(struct srd_channel)); + pdch = g_malloc(sizeof(struct srd_channel)); /* Add to list right away so it doesn't get lost. */ pdchl = g_slist_prepend(pdchl, pdch); @@ -340,7 +340,7 @@ static int get_options(struct srd_decoder *d) if (!py_item) goto except_out; - if (Py_TYPE(py_default) != Py_TYPE(py_item)) { + if (py_default && (Py_TYPE(py_default) != Py_TYPE(py_item))) { srd_err("All values for option '%s' must be " "of the same type as the default.", o->id); @@ -696,8 +696,6 @@ SRD_API int srd_decoder_load(const char *module_name) return SRD_OK; } - srd_dbg("Loading protocol decoder '%s'.", module_name); - d = g_malloc0(sizeof(struct srd_decoder)); fail_txt = NULL; @@ -920,8 +918,6 @@ SRD_API int srd_decoder_unload(struct srd_decoder *dec) if (!dec) return SRD_ERR_ARG; - srd_dbg("Unloading protocol decoder '%s'.", dec->name); - /* * Since any instances of this decoder need to be released as well, * but they could be anywhere in the stack, just free the entire