Ensure that newpath is always initialized, even for the error case.

This commit is contained in:
mjacob 2007-06-10 04:37:22 +00:00
parent 16bebbfda6
commit 96d1e042bf

View File

@ -239,6 +239,8 @@ linux_at(struct thread *td, int dirfd, char *filename, char **newpath, char **fr
*newpath = malloc(strlen(fullpath) + strlen(filename) + 2, M_TEMP, M_WAITOK | M_ZERO); *newpath = malloc(strlen(fullpath) + strlen(filename) + 2, M_TEMP, M_WAITOK | M_ZERO);
*freebuf = freepath; *freebuf = freepath;
sprintf(*newpath, "%s/%s", fullpath, filename); sprintf(*newpath, "%s/%s", fullpath, filename);
} else {
*newpath = NULL;
} }
vfslocked = VFS_LOCK_GIANT(dvp->v_mount); vfslocked = VFS_LOCK_GIANT(dvp->v_mount);
vrele(dvp); vrele(dvp);