X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=controller.c;h=9267ded40e653a14423c9446b23f8994e5366542;hb=efa641735217e5425f93e69cbaddf70d75c7e9e4;hp=2f766651864c2a34f8691797a2beb15b01da0246;hpb=e592ac8917d17665119b3647b5eae27fa387d6de;p=libsigrokdecode.git diff --git a/controller.c b/controller.c index 2f76665..9267ded 100644 --- a/controller.c +++ b/controller.c @@ -403,6 +403,7 @@ SRD_API int srd_inst_option_set(struct srd_decoder_inst *di, if (PyDict_SetItemString(py_di_options, key, py_optval) == -1) goto err_out; g_free(key); + key = NULL; } ret = SRD_OK; @@ -964,22 +965,21 @@ SRD_API int srd_pd_output_callback_add(int output_type, } /** @private */ -SRD_PRIV void *srd_pd_output_callback_find(int output_type) +SRD_PRIV struct srd_pd_callback *srd_pd_output_callback_find(int output_type) { GSList *l; - struct srd_pd_callback *pd_cb; - void *(cb); + struct srd_pd_callback *tmp, *pd_cb; - cb = NULL; + pd_cb = NULL; for (l = callbacks; l; l = l->next) { - pd_cb = l->data; - if (pd_cb->output_type == output_type) { - cb = pd_cb->cb; + tmp = l->data; + if (tmp->output_type == output_type) { + pd_cb = tmp; break; } } - return cb; + return pd_cb; } /* This is the backend function to Python sigrokdecode.add() call. */