The free(newfd) and free(path) calls can be passed unitialized
pointers if the
currfd = malloc()
call fails. Fix this by setting these pointers to NULL earlier.
Also *path is not used in the NFS_NOSYMLINK case, so move its
declaration inside the #ifndef block.
Fix two compile errors in the NFS_NOSYMLINK case:
currfd = malloc(sizeof(*newfd));
which fails because newfd is not defined, and
goto out;
which fails because the label is inside an #ifndef NFS_NOSYMLINK
block. Fix the latter by rearranging the function epilog a bit.
Also, fix the OLD_NFSV2 version of the code.