]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
src/tests/pathname.c: properly check strdup() return value
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Sun, 6 Jan 2013 04:45:11 +0000 (23:45 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 22 Mar 2013 14:39:01 +0000 (07:39 -0700)
Fix the check for strdup() running out of memory.

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>
(cherry picked from commit d9cc9c9dee9ad0213ddd39174e81d01b9707937b)

Change-Id: I56dc0dd7ced4df5be636a03db819169b5413e56b
Reviewed-on: http://gerrit.openafs.org/9514
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/tests/pathname.c

index 0057df87bb784476f54bdce6a2a7ebb4dd76ff52..19e43adc53114abf65d00c05858281242f38d5fd 100644 (file)
@@ -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");