- if (!(di->dec_probemap = g_try_malloc(sizeof(int) * di->dec_num_probes))) {
- srd_err("Failed to malloc probe map.");
- g_free(di);
- return NULL;
+ if (di->dec_num_probes) {
+ if (!(di->dec_probemap = g_try_malloc(sizeof(int) * di->dec_num_probes))) {
+ srd_err("Failed to malloc probe map.");
+ g_free(di);
+ return NULL;
+ }
+ for (i = 0; i < di->dec_num_probes; i++)
+ di->dec_probemap[i] = i;