tools/dumpscan/pathname.c: properly check strdup() return value

Fix the check for strdup() running out of memory.

Change-Id: I4e2d83036095c7b292ee4c386d8ed7b16ec75067
Reviewed-on: http://gerrit.openafs.org/8880
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Nickolai Zeldovich 2013-01-05 23:45:11 -05:00 committed by Jeffrey Altman
parent 0e83cde60e
commit d9cc9c9dee

View File

@ -278,7 +278,7 @@ Path_Build(XFILE * X, path_hashinfo * phi, afs_uint32 vnode, char **his_path,
if (vnode == 1) { if (vnode == 1) {
*his_path = strdup("/"); *his_path = strdup("/");
if (!his_path) { if (!*his_path) {
if (phi->p->cb_error) if (phi->p->cb_error)
(phi->p->cb_error) (ENOMEM, 1, phi->p->err_refcon, (phi->p->cb_error) (ENOMEM, 1, phi->p->err_refcon,
"No memory for pathname of vnode 1"); "No memory for pathname of vnode 1");