X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=sigrok-cli.c;h=1bf6c7d801d40770f99f1d075ed0d251925abf5e;hp=271cf0e545ec2301b8f7be6e6dc478e398e3bf42;hb=67ce0d2757835e1c23967277631dac87a61a3f82;hpb=c9ec7f07fd28f70874e7ec15566442021333ec8d diff --git a/sigrok-cli.c b/sigrok-cli.c index 271cf0e..1bf6c7d 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -495,14 +495,16 @@ static int register_pds(struct sr_device *device, const char *pdstring) goto err_out; } g_datalist_set_data(&pd_ann_visible, di->instance_id, pd_name); - } - /* Any keys left in the options hash are probes, where the key - * is the probe name as specified in the decoder class, and the - * value is the probe number i.e. the order in which the PD's - * incoming samples are arranged. */ - if (srd_instance_set_probes(di, pd_opthash) != SRD_OK) - return 1; + /* Any keys left in the options hash are probes, where the key + * is the probe name as specified in the decoder class, and the + * value is the probe number i.e. the order in which the PD's + * incoming samples are arranged. */ + if (srd_instance_set_probes(di, pd_opthash) != SRD_OK) + goto err_out; + g_hash_table_destroy(pd_opthash); + pd_opthash = NULL; + } err_out: g_strfreev(pdtokens);