diff options
author | Daniel Gustafsson <daniel@yesql.se> | 2018-10-03 00:56:29 +0200 |
---|---|---|
committer | Daniel Gustafsson <daniel@yesql.se> | 2018-10-03 23:45:38 +0200 |
commit | 2873971d6251b7c1eb278df1ee2b944d7c3fcdba (patch) | |
tree | 547fb9b9a1dcc8d9185c277d7c45ba746fad2fee /tests/unit/unit1303.c | |
parent | e182fc1613196540df12bcaa846e79f80aa5432c (diff) |
memory: ensure to check allocation results
The result of a memory allocation should always be checked, as we may
run under memory pressure where even a small allocation can fail. This
adds checking and error handling to a few cases where the allocation
wasn't checked for success. In the ftp case, the freeing of the path
variable is moved ahead of the allocation since there is little point
in keeping it around across the strdup, and the separation makes for
more readable code. In nwlib, the lock is aslo freed in the error path.
Also bumps the copyright years on affected files.
Closes #3084
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Diffstat (limited to 'tests/unit/unit1303.c')
0 files changed, 0 insertions, 0 deletions