for (type = types_offered; *type; type++)
{
t = wl_array_add(&input->data_types, sizeof(*t));
- *t = strdup(*type);
+ if (t) *t = strdup(*type);
wl_data_source_offer(input->data_source, *t);
}
/* add these types to the data source */
for (type = types_offered; *type; type++)
{
+ if (!*type) continue;
t = wl_array_add(&input->data_types, sizeof(*t));
- *t = strdup(*type);
- wl_data_source_offer(input->data_source, *t);
+ if (t)
+ {
+ *t = strdup(*type);
+ wl_data_source_offer(input->data_source, *t);
+ }
}
}
void
_ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source)
{
+ char **t;
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!source) return;
if (source->refcount == 0)
{
wl_data_offer_destroy(source->data_offer);
+ for (t = source->types.data; *t; t++)
+ free(*t);
wl_array_release(&source->types);
free(source);
}
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(source = data)) return;
+ if (!type) return;
t = wl_array_add(&source->types, sizeof(*t));
- *t = strdup(type);
+ if (t) *t = strdup(type);
}