mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks for that condition.
This commit is contained in:
parent
45850439b3
commit
4433248bf3
33 changed files with 108 additions and 205 deletions
15
src/names.c
15
src/names.c
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue