X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoder.c;h=87df2ad8f839d552494b1c6b6969a5167e5684f4;hp=6689bd488b5b07552b6f819f27a37f2642d8f1a4;hb=1d757906a2f8c881fcbbd1915420aa80a9d5da36;hpb=af0ca734f558aa04c55b15e119a451c85863888a diff --git a/decoder.c b/decoder.c index 6689bd4..87df2ad 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); @@ -937,7 +937,7 @@ SRD_API int srd_decoder_unload(struct srd_decoder *dec) return SRD_OK; } -static void srd_decoder_load_all_zip_path(char *path) +static void srd_decoder_load_all_zip_path(char *zip_path) { PyObject *zipimport_mod, *zipimporter_class, *zipimporter; PyObject *prefix_obj, *files, *key, *value, *set, *modname; @@ -958,7 +958,7 @@ static void srd_decoder_load_all_zip_path(char *path) if (zipimporter_class == NULL) goto err_out; - zipimporter = PyObject_CallFunction(zipimporter_class, "s", path); + zipimporter = PyObject_CallFunction(zipimporter_class, "s", zip_path); if (zipimporter == NULL) goto err_out;