mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-08 10:06:19 -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
|
|
@ -295,8 +295,7 @@ int snd_func_getenv(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
|
|||
free(res);
|
||||
}
|
||||
__error:
|
||||
if (def)
|
||||
free(def);
|
||||
free(def);
|
||||
return err;
|
||||
}
|
||||
#ifndef DOC_HIDDEN
|
||||
|
|
@ -419,8 +418,7 @@ int snd_func_concat(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
|
|||
tmp = realloc(res, len + len1 + 1);
|
||||
if (tmp == NULL) {
|
||||
free(ptr);
|
||||
if (res)
|
||||
free(res);
|
||||
free(res);
|
||||
err = -ENOMEM;
|
||||
goto __error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue