remove superfluous free() checks

free() correctly handles NULL pointers, so we can omit explicit checks
for that condition.
This commit is contained in:
Clemens Ladisch 2006-02-27 09:58:32 +00:00
parent 45850439b3
commit 4433248bf3
33 changed files with 108 additions and 205 deletions

View file

@ -105,17 +105,14 @@ static int names_parse(snd_config_t *top, const char *iface, snd_devname_t **lis
}
last = dn;
} else {
if (comment != NULL)
free(comment);
free(comment);
}
}
return 0;
_err:
if (name)
free(name);
if (comment)
free(comment);
free(name);
free(comment);
return err;
}
@ -189,10 +186,8 @@ void snd_names_list_free(snd_devname_t *list)
while (list != NULL) {
next = list->next;
if (list->name)
free(list->name);
if (list->comment)
free(list->comment);
free(list->name);
free(list->comment);
free(list);
list = next;
}