diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2006-02-27 09:58:32 +0000 |
---|---|---|
committer | Clemens Ladisch <clemens@ladisch.de> | 2006-02-27 09:58:32 +0000 |
commit | 4433248bf3d6a89ca2136f41198ca2c9aa566953 (patch) | |
tree | 1f2ed4076d09433be3ed90721a654df9a4656d40 /src/confmisc.c | |
parent | 45850439b3b28ff7ed0d1455f62f5a85572caefa (diff) |
remove superfluous free() checks
free() correctly handles NULL pointers, so we can omit explicit checks
for that condition.
Diffstat (limited to 'src/confmisc.c')
-rw-r--r-- | src/confmisc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/confmisc.c b/src/confmisc.c index 2b5efb14..147ca647 100644 --- a/src/confmisc.c +++ b/src/confmisc.c @@ -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; } |