]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage_backend_fs: avoid NULL dereference on opendir failure
authorJim Meyering <meyering@redhat.com>
Wed, 2 Sep 2009 07:42:32 +0000 (09:42 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 3 Sep 2009 16:04:23 +0000 (18:04 +0200)
* src/storage_backend_fs.c (virStorageBackendFileSystemRefresh):
Don't call closedir on a NULL pointer.

src/storage_backend_fs.c

index 65b656d47f5ecc6110dcd5a2dbb404f9d6d09d72..82415049cedf22c47f9111cbe1dbe2af981b08a7 100644 (file)
@@ -983,7 +983,8 @@ no_memory:
     /* fallthrough */
 
  cleanup:
-    closedir(dir);
+    if (dir)
+        closedir(dir);
     virStorageVolDefFree(vol);
     virStoragePoolObjClearVols(pool);
     return -1;