From: Nickolai Zeldovich Date: Sun, 6 Jan 2013 04:45:11 +0000 (-0500) Subject: src/tests/pathname.c: properly check strdup() return value X-Git-Tag: upstream/1.6.3^2~105 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8a6b943b3f057f5e7995d9687ddc9574f3e55ddc;p=packages%2Fo%2Fopenafs.git src/tests/pathname.c: properly check strdup() return value Fix the check for strdup() running out of memory. Reviewed-on: http://gerrit.openafs.org/8880 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: BuildBot (cherry picked from commit d9cc9c9dee9ad0213ddd39174e81d01b9707937b) Change-Id: I56dc0dd7ced4df5be636a03db819169b5413e56b Reviewed-on: http://gerrit.openafs.org/9514 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- diff --git a/src/tests/pathname.c b/src/tests/pathname.c index 0057df87b..19e43adc5 100644 --- a/src/tests/pathname.c +++ b/src/tests/pathname.c @@ -280,7 +280,7 @@ Path_Build(XFILE * X, path_hashinfo * phi, afs_uint32 vnode, char **his_path, if (vnode == 1) { *his_path = (char *)malloc(2); - if (!his_path) { + if (!*his_path) { if (phi->p->cb_error) (phi->p->cb_error) (ENOMEM, 1, phi->p->err_refcon, "No memory for pathname of vnode 1");