int dict_addvalue(const char *namestr, const char *attrstr, int value);
int dict_init(const char *dir, const char *fn);
void dict_free(void);
-void dict_attr_free(const DICT_ATTR *da);
+void dict_attr_free(DICT_ATTR * const *da);
const DICT_ATTR *dict_attr_copy(const DICT_ATTR *da);
const DICT_ATTR *dict_attrunknown(unsigned int attr, unsigned int vendor);
const DICT_ATTR *dict_attrunknownbyname(const char *attribute);
*
* @param da to free.
*/
-void dict_attr_free(const DICT_ATTR *da)
+void dict_attr_free(DICT_ATTR * const *da)
{
- DICT_ATTR *tmp;
+ DICT_ATTR **tmp;
/* Don't free real DAs */
- if (!da->flags.is_unknown) {
+ if (!(*da)->flags.is_unknown) {
return;
}
- memcpy(&tmp, &da, sizeof(tmp));
- free(tmp);
+ memcpy(&tmp, &da, sizeof(*tmp));
+ free(*tmp);
+
+ *tmp = NULL;
}
/** Copies a dictionary attr