Commit 2873971d authored by Daniel Gustafsson's avatar Daniel Gustafsson
Browse files

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: default avatarJay Satiro <raysatiro@yahoo.com>
Reviewed-by: default avatarDaniel Stenberg <daniel@haxx.se>
parent e182fc16
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment